Medical Imaging Interaction Toolkit  2016.11.0
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
 
virtual void GenerateData () override
 
virtual 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
 
virtual itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 
virtual 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 ()
 
virtual ~ImageToSurfaceFilter ()
 
void CreateSurface (int time, vtkImageData *vtkimage, mitk::Surface *surface, const ScalarType threshold)
 
- Protected Member Functions inherited from mitk::SurfaceSource
 SurfaceSource ()
 
virtual ~SurfaceSource ()
 
- Protected Member Functions inherited from mitk::BaseDataSource
 BaseDataSource ()
 
virtual ~BaseDataSource ()
 

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 54 of file mitkImageToSurfaceFilter.h.

Member Typedef Documentation

Constructor & Destructor Documentation

mitk::ImageToSurfaceFilter::ImageToSurfaceFilter ( )
protected

Definition at line 33 of file mitkImageToSurfaceFilter.cpp.

mitk::ImageToSurfaceFilter::~ImageToSurfaceFilter ( )
protectedvirtual

Destructor

Definition at line 43 of file mitkImageToSurfaceFilter.cpp.

Member Function Documentation

Pointer mitk::ImageToSurfaceFilter::Clone ( ) const
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()

Definition at line 47 of file mitkImageToSurfaceFilter.cpp.

References mitk::ProgressBar::GetInstance(), mitk::New(), mitk::ProgressBar::Progress(), and mitk::Surface::SetVtkPolyData().

void mitk::ImageToSurfaceFilter::GenerateData ( )
overridevirtual
void mitk::ImageToSurfaceFilter::GenerateOutputInformation ( )
overridevirtual

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

Reimplemented in mitk::LabeledImageToSurfaceFilter, and mitk::ImageToContourFilter.

Definition at line 221 of file mitkImageToSurfaceFilter.cpp.

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

Reimplemented from mitk::SurfaceSource.

Definition at line 70 of file mitkImageToSurfaceFilter.h.

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

Reimplemented from mitk::SurfaceSource.

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

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

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

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

Definition at line 211 of file mitkImageToSurfaceFilter.cpp.

Referenced by mitk::ImageToContourFilter::GenerateData().

virtual bool mitk::ImageToSurfaceFilter::GetSmooth ( ) const
virtual
static const char* mitk::ImageToSurfaceFilter::GetStaticNameOfClass ( )
inlinestatic

Definition at line 70 of file mitkImageToSurfaceFilter.h.

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

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

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

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

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 182 of file mitkImageToSurfaceFilter.h.

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.

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

Definition at line 205 of file mitkImageToSurfaceFilter.cpp.

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.

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 choosen. The VTK documentation recommends small relaxation factors and large numbers of iterations.

Definition at line 195 of file mitkImageToSurfaceFilter.cpp.

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 choosen. The VTK documentation recommends small relaxation factors and large numbers of iterations.

Definition at line 200 of file mitkImageToSurfaceFilter.cpp.

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%.

Parameters
Seta TargetReduction float-value from 0.0 to 1.0
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)

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

Member Data Documentation

DecimationType mitk::ImageToSurfaceFilter::m_Decimate
protected

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

Definition at line 224 of file mitkImageToSurfaceFilter.h.

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 219 of file mitkImageToSurfaceFilter.h.

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 241 of file mitkImageToSurfaceFilter.h.

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 247 of file mitkImageToSurfaceFilter.h.

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 235 of file mitkImageToSurfaceFilter.h.

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 230 of file mitkImageToSurfaceFilter.h.


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