Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitk::ImageToSurfaceFilter Class Reference

Converts pixel data to surface data by using a threshold The mitkImageToSurfaceFilter is used to create a new surface out of an mitk image. The filter uses a threshold to define the surface. It is based on the vtkMarchingCube algorithm. By default a vtkPolyData surface based on an input threshold for the input image will be created. Optional it is possible to reduce the number of triangles/polygones [SetDecimate(mitk::ImageToSurfaceFilter::DecimatePro) and SetTargetReduction (float _arg)] or smooth the surface-data [SetSmooth(true), SetSmoothIteration(int smoothIteration) and SetSmoothRelaxation(float smoothRelaxation)]. More...

#include <mitkImageToSurfaceFilter.h>

Inheritance diagram for mitk::ImageToSurfaceFilter:
Collaboration diagram for mitk::ImageToSurfaceFilter:

Public Types

enum  DecimationType { NoDecimation, DecimatePro, QuadricDecimation }
 
typedef ImageToSurfaceFilter Self
 
typedef SurfaceSource Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
- Public Types inherited from mitk::SurfaceSource
typedef SurfaceSource Self
 
typedef BaseDataSource Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef Surface OutputType
 
- Public Types inherited from mitk::BaseDataSource
typedef BaseDataSource Self
 
typedef itk::ProcessObject Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef BaseData OutputType
 
typedef itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType
 

Public Member Functions

virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
void GenerateData () override
 
void GenerateOutputInformation () override
 
const mitk::ImageGetInput (void)
 
virtual void SetInput (const mitk::Image *image)
 
void SetSmoothIteration (int smoothIteration)
 
void SetSmoothRelaxation (float smoothRelaxation)
 
virtual void SetThreshold (ScalarType _arg)
 
virtual ScalarType GetThreshold () const
 
virtual void SetSmooth (bool _arg)
 
virtual void SmoothOn ()
 
virtual void SmoothOff ()
 
virtual bool GetSmooth () const
 
virtual DecimationType GetDecimate () const
 
virtual void SetDecimate (DecimationType _arg)
 
virtual void SetTargetReduction (float _arg)
 
virtual float GetTargetReduction () const
 
template<class T1 , class T2 , class T3 >
void mitkVtkLinearTransformPoint (T1 matrix[4][4], T2 in[3], T3 out[3])
 
- Public Member Functions inherited from mitk::SurfaceSource
Pointer Clone () const
 
OutputTypeGetOutput ()
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (DataObjectPointerArraySizeType idx) const
 
itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 
itk::DataObject::Pointer MakeOutput (const DataObjectIdentifierType &name) override
 
- Public Member Functions inherited from mitk::BaseDataSource
OutputTypeGetOutput ()
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (DataObjectPointerArraySizeType idx) const
 
virtual void GraftOutput (OutputType *output)
 Graft the specified BaseData onto this BaseDataSource's output. More...
 
virtual void GraftOutput (const DataObjectIdentifierType &key, OutputType *output)
 
virtual void GraftNthOutput (unsigned int idx, OutputType *output)
 Graft the specified base data object onto this BaseDataSource's idx'th output. More...
 
bool Updating () const
 Access itk::ProcessObject::m_Updating. More...
 

Static Public Member Functions

static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 
- Static Public Member Functions inherited from mitk::SurfaceSource
static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 
- Static Public Member Functions inherited from mitk::BaseDataSource
static const char * GetStaticNameOfClass ()
 

Protected Member Functions

 ImageToSurfaceFilter ()
 
 ~ImageToSurfaceFilter () override
 
void CreateSurface (int time, vtkImageData *vtkimage, mitk::Surface *surface, const ScalarType threshold)
 
- Protected Member Functions inherited from mitk::SurfaceSource
 SurfaceSource ()
 
 ~SurfaceSource () override
 
- Protected Member Functions inherited from mitk::BaseDataSource
 BaseDataSource ()
 
 ~BaseDataSource () override
 

Protected Attributes

bool m_Smooth
 
DecimationType m_Decimate
 
ScalarType m_Threshold
 
float m_TargetReduction
 
int m_SmoothIteration
 
float m_SmoothRelaxation
 

Additional Inherited Members

- Static Protected Member Functions inherited from mitk::BaseDataSource
static Pointer New ()
 

Detailed Description

Converts pixel data to surface data by using a threshold The mitkImageToSurfaceFilter is used to create a new surface out of an mitk image. The filter uses a threshold to define the surface. It is based on the vtkMarchingCube algorithm. By default a vtkPolyData surface based on an input threshold for the input image will be created. Optional it is possible to reduce the number of triangles/polygones [SetDecimate(mitk::ImageToSurfaceFilter::DecimatePro) and SetTargetReduction (float _arg)] or smooth the surface-data [SetSmooth(true), SetSmoothIteration(int smoothIteration) and SetSmoothRelaxation(float smoothRelaxation)].

The resulting vtk-surface has the same size as the input image. The surface can be generally smoothed by vtkDecimatePro reduce complexity of triangles and vtkSmoothPolyDataFilter to relax the mesh. Both are enabled by default and connected in the common way of pipelining in ITK. It's also possible to create time sliced surfaces.

Definition at line 50 of file mitkImageToSurfaceFilter.h.

Member Typedef Documentation

◆ ConstPointer

◆ Pointer

◆ Self

◆ Superclass

Member Enumeration Documentation

◆ DecimationType

Enumerator
NoDecimation 
DecimatePro 
QuadricDecimation 

Definition at line 59 of file mitkImageToSurfaceFilter.h.

Constructor & Destructor Documentation

◆ ImageToSurfaceFilter()

mitk::ImageToSurfaceFilter::ImageToSurfaceFilter ( )
protected

◆ ~ImageToSurfaceFilter()

mitk::ImageToSurfaceFilter::~ImageToSurfaceFilter ( )
overrideprotected

Destructor

Member Function Documentation

◆ Clone()

Pointer mitk::ImageToSurfaceFilter::Clone ( ) const

◆ CreateSurface()

void mitk::ImageToSurfaceFilter::CreateSurface ( int  time,
vtkImageData *  vtkimage,
mitk::Surface surface,
const ScalarType  threshold 
)
protected

With the given threshold vtkMarchingCube creates the surface. By default nothing a vtkPolyData surface based on a threshold of the input image will be created. Optional it is possible to reduce the number of triangles/polygones [SetDecimate(mitk::ImageToSurfaceFilter::DecimatePro) and SetTargetReduction (float _arg)] or smooth the data [SetSmooth(true), SetSmoothIteration(int smoothIteration) and SetSmoothRelaxation(float smoothRelaxation)].

Parameters
timeselected slice or "0" for single
*vtkimageinput image
*surfaceoutput
thresholdcan be different from SetThreshold()

◆ GenerateData()

void mitk::ImageToSurfaceFilter::GenerateData ( )
override

For each image time slice a surface will be created. This method is called by Update().

◆ GenerateOutputInformation()

void mitk::ImageToSurfaceFilter::GenerateOutputInformation ( )
override

Initializes the output information ( i.e. the geometry information ) of the output of the filter

◆ GetClassHierarchy()

virtual std::vector<std::string> mitk::ImageToSurfaceFilter::GetClassHierarchy ( ) const
inlineoverridevirtual

Reimplemented from mitk::SurfaceSource.

Definition at line 66 of file mitkImageToSurfaceFilter.h.

◆ GetClassName()

virtual const char* mitk::ImageToSurfaceFilter::GetClassName ( ) const
virtual

Reimplemented from mitk::SurfaceSource.

◆ GetDecimate()

virtual DecimationType mitk::ImageToSurfaceFilter::GetDecimate ( ) const
virtual

Get the state of decimation mode to reduce triangle in the surface representation. Modes can only be NoDecimation or DecimatePro (till vtk 4.x also Decimate)

◆ GetInput()

const mitk::Image* mitk::ImageToSurfaceFilter::GetInput ( void  )

Returns a const reference to the input image (e.g. the original input image that is used to create the surface)

◆ GetSmooth()

virtual bool mitk::ImageToSurfaceFilter::GetSmooth ( ) const
virtual

◆ GetStaticNameOfClass()

static const char* mitk::ImageToSurfaceFilter::GetStaticNameOfClass ( )
inlinestatic

Definition at line 66 of file mitkImageToSurfaceFilter.h.

◆ GetTargetReduction()

virtual float mitk::ImageToSurfaceFilter::GetTargetReduction ( ) const
virtual

Returns the reduction factor for the VtkDecimatePro Decimation Filter as a float value

◆ GetThreshold()

virtual ScalarType mitk::ImageToSurfaceFilter::GetThreshold ( ) const
virtual

Get Threshold from vtkMarchingCube. Threshold can be manipulated by inherited classes.

◆ mitkVtkLinearTransformPoint()

template<class T1 , class T2 , class T3 >
void mitk::ImageToSurfaceFilter::mitkVtkLinearTransformPoint ( T1  matrix[4][4],
T2  in[3],
T3  out[3] 
)
inline

Transforms a point by a 4x4 matrix

Definition at line 177 of file mitkImageToSurfaceFilter.h.

◆ New()

static Pointer mitk::ImageToSurfaceFilter::New ( )
static

◆ SetDecimate()

virtual void mitk::ImageToSurfaceFilter::SetDecimate ( DecimationType  _arg)
virtual

Enable the decimation filter to reduce the number of triangles in the mesh and produce a good approximation to the original image. The filter has support for vtk-5 and earlier versions. More detailed information check the vtkDecimatePro and vtkDecimate.

◆ SetInput()

virtual void mitk::ImageToSurfaceFilter::SetInput ( const mitk::Image image)
virtual

◆ SetSmooth()

virtual void mitk::ImageToSurfaceFilter::SetSmooth ( bool  _arg)
virtual

Enables vtkSmoothPolyDataFilter. With Laplacian smoothing this filter will relax the surface. You can control the Filter by manipulating the number of iterations and the relaxing factor.

◆ SetSmoothIteration()

void mitk::ImageToSurfaceFilter::SetSmoothIteration ( int  smoothIteration)

Set the number of iterations that is used to smooth the surface. Used is the vtkSmoothPolydataFilter that uses the laplacian filter. The higher the number of iterations that stronger the smooth-result

Parameters
smoothIterationAs smoothIteration default in that case 50 was chosen. The VTK documentation recommends small relaxation factors and large numbers of iterations.

◆ SetSmoothRelaxation()

void mitk::ImageToSurfaceFilter::SetSmoothRelaxation ( float  smoothRelaxation)

Set number of relaxation. Specify the relaxation factor for Laplacian smoothing. The VTK documentation recommends small relaxation factors and large numbers of iterations.

Parameters
smoothRelaxationAs smoothRelaxation default in that case 0.1 was chosen. The VTK documentation recommends small relaxation factors and large numbers of iterations.

◆ SetTargetReduction()

virtual void mitk::ImageToSurfaceFilter::SetTargetReduction ( float  _arg)
virtual

Set desired TargetReduction of triangles in the range from 0.0 to 1.0. The destroyed triangles are in relation with the size of data. For example 0.9 will reduce the data set to 10%.

◆ SetThreshold()

virtual void mitk::ImageToSurfaceFilter::SetThreshold ( ScalarType  _arg)
virtual

Threshold that is used to create the surface. All pixel in the input image that are higher than that value will be considered in the surface. The threshold referees to vtkMarchingCube. Default value is 1. See also SetThreshold (ScalarType _arg)

◆ SmoothOff()

virtual void mitk::ImageToSurfaceFilter::SmoothOff ( )
virtual

◆ SmoothOn()

virtual void mitk::ImageToSurfaceFilter::SmoothOn ( )
virtual

Member Data Documentation

◆ m_Decimate

DecimationType mitk::ImageToSurfaceFilter::m_Decimate
protected

Decimation mode, default mode is "NoDecimation". See also SetDecimate (DecimationType _arg)

Definition at line 219 of file mitkImageToSurfaceFilter.h.

◆ m_Smooth

bool mitk::ImageToSurfaceFilter::m_Smooth
protected

Flag whether the created surface shall be smoothed or not (default is "false"). SetSmooth (bool _arg)

Definition at line 214 of file mitkImageToSurfaceFilter.h.

◆ m_SmoothIteration

int mitk::ImageToSurfaceFilter::m_SmoothIteration
protected

The Iteration value for the Smooth Filter of the created surface. See also SetSmoothIteration (int smoothIteration)

Definition at line 236 of file mitkImageToSurfaceFilter.h.

◆ m_SmoothRelaxation

float mitk::ImageToSurfaceFilter::m_SmoothRelaxation
protected

The Relaxation value for the Smooth Filter of the created surface. See also SetSmoothRelaxation (float smoothRelaxation)

Definition at line 242 of file mitkImageToSurfaceFilter.h.

◆ m_TargetReduction

float mitk::ImageToSurfaceFilter::m_TargetReduction
protected

The Reduction factor of the Decimation Filter for the created surface. See also SetTargetReduction (float _arg)

Definition at line 230 of file mitkImageToSurfaceFilter.h.

◆ m_Threshold

ScalarType mitk::ImageToSurfaceFilter::m_Threshold
protected

Threshold that is used to create the surface. All pixel in the input image that are higher than that value will be considered in the surface. Default value is 1. See also SetThreshold (ScalarType _arg)

Definition at line 225 of file mitkImageToSurfaceFilter.h.


The documentation for this class was generated from the following file: