Medical Imaging Interaction Toolkit
2018.4.99-389bf124
Medical Imaging Interaction Toolkit
|
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>
Public Types | |
enum | DecimationType { NoDecimation, DecimatePro, QuadricDecimation } |
typedef ImageToSurfaceFilter | Self |
typedef SurfaceSource | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
![]() | |
typedef SurfaceSource | Self |
typedef BaseDataSource | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef Surface | OutputType |
![]() | |
typedef BaseDataSource | Self |
typedef itk::ProcessObject | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer< const Self > | ConstPointer |
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::Image * | GetInput (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]) |
![]() | |
Pointer | Clone () const |
OutputType * | GetOutput () |
const OutputType * | GetOutput () const |
OutputType * | GetOutput (DataObjectPointerArraySizeType idx) |
const OutputType * | GetOutput (DataObjectPointerArraySizeType idx) const |
itk::DataObject::Pointer | MakeOutput (DataObjectPointerArraySizeType idx) override |
itk::DataObject::Pointer | MakeOutput (const DataObjectIdentifierType &name) override |
![]() | |
OutputType * | GetOutput () |
const OutputType * | GetOutput () const |
OutputType * | GetOutput (DataObjectPointerArraySizeType idx) |
const OutputType * | GetOutput (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 const char * | GetStaticNameOfClass () |
static Pointer | New () |
![]() | |
static const char * | GetStaticNameOfClass () |
Protected Member Functions | |
ImageToSurfaceFilter () | |
~ImageToSurfaceFilter () override | |
void | CreateSurface (int time, vtkImageData *vtkimage, mitk::Surface *surface, const ScalarType threshold) |
![]() | |
SurfaceSource () | |
~SurfaceSource () override | |
![]() | |
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 Pointer | New () |
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.
typedef itk::SmartPointer<const Self> mitk::ImageToSurfaceFilter::ConstPointer |
Definition at line 66 of file mitkImageToSurfaceFilter.h.
Definition at line 66 of file mitkImageToSurfaceFilter.h.
Definition at line 66 of file mitkImageToSurfaceFilter.h.
Definition at line 66 of file mitkImageToSurfaceFilter.h.
Enumerator | |
---|---|
NoDecimation | |
DecimatePro | |
QuadricDecimation |
Definition at line 59 of file mitkImageToSurfaceFilter.h.
|
protected |
Definition at line 29 of file mitkImageToSurfaceFilter.cpp.
|
overrideprotected |
Destructor
Definition at line 39 of file mitkImageToSurfaceFilter.cpp.
Pointer mitk::ImageToSurfaceFilter::Clone | ( | ) | const |
|
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)].
time | selected slice or "0" for single |
*vtkimage | input image |
*surface | output |
threshold | can be different from SetThreshold() |
Definition at line 43 of file mitkImageToSurfaceFilter.cpp.
References DecimatePro, mitk::BaseData::GetGeometry(), GetInput(), mitk::ProgressBar::GetInstance(), mitk::BaseGeometry::GetSpacing(), mitk::BaseGeometry::GetVtkTransform(), m_Decimate, m_Smooth, m_SmoothIteration, m_SmoothRelaxation, m_TargetReduction, mitkVtkLinearTransformPoint(), mitk::ProgressBar::Progress(), QuadricDecimation, and mitk::Surface::SetVtkPolyData().
Referenced by mitk::ManualSegmentationToSurfaceFilter::GenerateData(), and GenerateData().
|
override |
For each image time slice a surface will be created. This method is called by Update().
Definition at line 165 of file mitkImageToSurfaceFilter.cpp.
References mitk::ProgressBar::AddStepsToDo(), CreateSurface(), GetInput(), mitk::ProgressBar::GetInstance(), mitk::SurfaceSource::GetOutput(), image, m_Threshold, mitkThrow, and mitk::ProgressBar::Progress().
|
override |
Initializes the output information ( i.e. the geometry information ) of the output of the filter
Definition at line 217 of file mitkImageToSurfaceFilter.cpp.
References GetInput(), and mitk::SurfaceSource::GetOutput().
|
inlineoverridevirtual |
Reimplemented from mitk::SurfaceSource.
Definition at line 66 of file mitkImageToSurfaceFilter.h.
|
virtual |
Reimplemented from mitk::SurfaceSource.
|
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 207 of file mitkImageToSurfaceFilter.cpp.
Referenced by mitk::LabeledImageToSurfaceFilter::CreateSurface(), CreateSurface(), mitk::ManualSegmentationToSurfaceFilter::GenerateData(), GenerateData(), mitk::ImageToContourFilter::GenerateData(), mitk::LabeledImageToSurfaceFilter::GenerateData(), GenerateOutputInformation(), mitk::LabeledImageToSurfaceFilter::GenerateOutputInformation(), mitk::LabeledImageToSurfaceFilter::GetAvailableLabels(), and mitk::LabeledImageToSurfaceFilter::GetVolumeForLabel().
|
virtual |
|
inlinestatic |
Definition at line 66 of file mitkImageToSurfaceFilter.h.
|
virtual |
Returns the reduction factor for the VtkDecimatePro Decimation Filter as a float value
|
virtual |
Get Threshold from vtkMarchingCube. Threshold can be manipulated by inherited classes.
|
inline |
Transforms a point by a 4x4 matrix
Definition at line 179 of file mitkImageToSurfaceFilter.h.
Referenced by mitk::LabeledImageToSurfaceFilter::CreateSurface(), and CreateSurface().
|
static |
|
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.
|
virtual |
Definition at line 201 of file mitkImageToSurfaceFilter.cpp.
|
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
smoothIteration | As smoothIteration default in that case 50 was choosen. The VTK documentation recommends small relaxation factors and large numbers of iterations. |
Definition at line 191 of file mitkImageToSurfaceFilter.cpp.
References m_SmoothIteration.
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.
smoothRelaxation | As smoothRelaxation default in that case 0.1 was choosen. The VTK documentation recommends small relaxation factors and large numbers of iterations. |
Definition at line 196 of file mitkImageToSurfaceFilter.cpp.
References m_SmoothRelaxation.
|
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%.
Set | a TargetReduction float-value from 0.0 to 1.0 |
|
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 |
|
virtual |
|
protected |
Decimation mode, default mode is "NoDecimation". See also SetDecimate (DecimationType _arg)
Definition at line 221 of file mitkImageToSurfaceFilter.h.
Referenced by mitk::LabeledImageToSurfaceFilter::CreateSurface(), and CreateSurface().
|
protected |
Flag whether the created surface shall be smoothed or not (default is "false"). SetSmooth (bool _arg)
Definition at line 216 of file mitkImageToSurfaceFilter.h.
Referenced by mitk::LabeledImageToSurfaceFilter::CreateSurface(), and CreateSurface().
|
protected |
The Iteration value for the Smooth Filter of the created surface. See also SetSmoothIteration (int smoothIteration)
Definition at line 238 of file mitkImageToSurfaceFilter.h.
Referenced by mitk::LabeledImageToSurfaceFilter::CreateSurface(), CreateSurface(), and SetSmoothIteration().
|
protected |
The Relaxation value for the Smooth Filter of the created surface. See also SetSmoothRelaxation (float smoothRelaxation)
Definition at line 244 of file mitkImageToSurfaceFilter.h.
Referenced by mitk::LabeledImageToSurfaceFilter::CreateSurface(), CreateSurface(), and SetSmoothRelaxation().
|
protected |
The Reduction factor of the Decimation Filter for the created surface. See also SetTargetReduction (float _arg)
Definition at line 232 of file mitkImageToSurfaceFilter.h.
Referenced by mitk::LabeledImageToSurfaceFilter::CreateSurface(), and CreateSurface().
|
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 227 of file mitkImageToSurfaceFilter.h.
Referenced by mitk::ManualSegmentationToSurfaceFilter::GenerateData(), and GenerateData().