13 #ifndef mitkImageToSurfaceFilter_h
14 #define mitkImageToSurfaceFilter_h
20 #include <vtkPolyData.h>
23 #include <vtkImageData.h>
25 #include <vtkMarchingCubes.h>
26 #include <vtkSmoothPolyDataFilter.h>
66 itkFactorylessNewMacro(Self);
91 using itk::ProcessObject::SetInput;
135 itkSetMacro(Smooth,
bool);
138 itkBooleanMacro(Smooth);
141 itkGetConstMacro(Smooth,
bool);
163 itkSetMacro(TargetReduction,
float);
168 itkGetConstMacro(TargetReduction,
float);
177 template <
class T1,
class T2,
class T3>
180 T3 x = matrix[0][0] * in[0] + matrix[0][1] * in[1] + matrix[0][2] * in[2] + matrix[0][3];
181 T3 y = matrix[1][0] * in[0] + matrix[1][1] * in[1] + matrix[1][2] * in[2] + matrix[1][3];
182 T3 z = matrix[2][0] * in[0] + matrix[2][1] * in[1] + matrix[2][2] * in[2] + matrix[2][3];
Converts pixel data to surface data by using a threshold.
int m_SmoothIteration
The number of iterations for the smoothing filter. Default is 50.
mitkClassMacro(ImageToSurfaceFilter, SurfaceSource)
float m_SmoothRelaxation
The relaxation factor for the smoothing filter. Default is 0.1.
const mitk::Image * GetInput(void)
bool m_Smooth
Flag whether the created surface shall be smoothed (default is false).
DecimationType m_Decimate
Decimation mode. Default is NoDecimation.
void CreateSurface(int time, vtkImageData *vtkimage, mitk::Surface *surface, const ScalarType threshold)
Create the surface for a single time step using vtkMarchingCubes.
virtual void SetInput(const mitk::Image *image)
void mitkVtkLinearTransformPoint(T1 matrix[4][4], T2 in[3], T3 out[3])
Transform a 3D point by a 4x4 matrix (affine transformation).
~ImageToSurfaceFilter() override
Destructor.
float m_TargetReduction
The reduction factor for the decimation filter. Range [0.0, 1.0].
void SetSmoothRelaxation(float smoothRelaxation)
Set the relaxation factor for Laplacian smoothing.
void GenerateOutputInformation() override
void SetSmoothIteration(int smoothIteration)
Set the number of iterations used to smooth the surface.
DecimationType
Enumeration of available polygon decimation strategies.
ScalarType m_Threshold
Threshold for surface extraction. Default value is 1.
void GenerateData() override
Image class for storing multi-dimensional medical image data.
Superclass of all classes generating surfaces (instances of class Surface) as output.
Data class for storing polygonal surfaces (vtkPolyData).
Find image slices visible on a given plane.
double ScalarType
Scalar type used throughout MITK for geometric computations.