Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 55e5c3c1 authored by Martin Genet's avatar Martin Genet
Browse files

new default configuration for image expressions

parent 37ea1bbc
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,15 @@ def get_ExprIm_cpp(
assert (im_type in ("im","grad"))
ExprIm_cpp = '''\
#include <string.h>
#include <vtkSmartPointer.h>
#include <vtkStructuredPointsReader.h>
#include <vtkXMLImageDataReader.h>
#include <vtkImageData.h>'''+('''
#include <vtkImageGradient.h>''')*(im_type=="grad")+'''
#include <vtkImageInterpolator.h>
double getStaticScalingFactor(const char* scalar_type_as_string)
{
if (strcmp(scalar_type_as_string, "unsigned char" ) == 0) return pow(2, 8)-1;
......@@ -31,14 +40,6 @@ double getStaticScalingFactor(const char* scalar_type_as_string)
assert (0);
}
#include <string.h>
#include <vtkSmartPointer.h>
#include <vtkXMLImageDataReader.h>
#include <vtkImageData.h>'''+('''
#include <vtkImageGradient.h>''')*(im_type=="grad")+'''
#include <vtkImageInterpolator.h>
namespace dolfin
{
......@@ -90,7 +91,7 @@ public:
void init_image(
const char* filename,
const char* interpol_mode="'''+('''linear''')*(im_type=="im")+('''linear''')*(im_type=="grad")+'''",
const char* interpol_mode="'''+('''nearest''')*(im_type=="im")+('''nearest''')*(im_type=="grad")+'''",
const double &interpol_out_value='''+('''0.''')*(im_type=="im")+('''0.''')*(im_type=="grad")+(''',
const double &Z=0.''')*(im_dim==2)+''')
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment