Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
mitk::ToFDistanceImageToSurfaceFilter Class Reference

Converts a Time-of-Flight (ToF) distance image to a 3D surface using the pinhole camera model for coordinate computation. The intrinsic parameters of the camera (FocalLength, PrincipalPoint, InterPixelDistance) are set via SetCameraIntrinsics(). The measured distance for each pixel corresponds to the distance between the object point and the corresponding image point on the image plane. More...

#include <mitkToFDistanceImageToSurfaceFilter.h>

Inheritance diagram for mitk::ToFDistanceImageToSurfaceFilter:
Collaboration diagram for mitk::ToFDistanceImageToSurfaceFilter:

Public Types

enum  ReconstructionModeType { WithOutInterPixelDistance, WithInterPixelDistance, Kinect }
 The ReconstructionModeType enum: Defines the reconstruction mode, if using no interpixeldistances and focal lenghts in pixel units or interpixeldistances and focal length in mm. The Kinect option defines a special reconstruction mode for the kinect. More...
 
- 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

 mitkClassMacro (ToFDistanceImageToSurfaceFilter, SurfaceSource)
 
Pointer Clone () const
 
virtual void SetCameraIntrinsics (mitk::CameraIntrinsics::Pointer _arg)
 
virtual mitk::CameraIntrinsics::Pointer GetCameraIntrinsics ()
 
virtual void SetInterPixelDistance (ToFProcessingCommon::ToFPoint2D _arg)
 
virtual ToFProcessingCommon::ToFPoint2D GetInterPixelDistance ()
 
virtual void SetTextureIndex (int _arg)
 
void SetTriangulationThreshold (double triangulationThreshold)
 SetTriangulationThreshold Sets a triangulation threshold in order to remove unusually huge faces from the surface. If this value is set, the filter will check whether the distance between two neighboring vertices exceeds the triangulation threshold. If yes, there vertices will not be triangulated (connected with lines). The vertices will still be added to the surface, but only as single point (if they have no other neighbors). More...
 
virtual double GetTriangulationThreshold ()
 
virtual void SetVertexIdList (vtkSmartPointer< vtkIdList > _arg)
 
virtual vtkSmartPointer< vtkIdList > GetVertexIdList ()
 
virtual void SetGenerateTriangularMesh (bool _arg)
 
virtual bool GetGenerateTriangularMesh ()
 
 itkSetEnumMacro (ReconstructionMode, ReconstructionModeType)
 
 itkGetEnumMacro (ReconstructionMode, ReconstructionModeType)
 
void SetScalarImage (IplImage *iplScalarImage)
 Set scalar image used as texture of the surface. More...
 
IplImage * GetScalarImage ()
 Set scalar image used as texture of the surface. More...
 
void SetTextureImageWidth (int width)
 Set width of the scalar image used for texturing the surface. More...
 
void SetTextureImageHeight (int height)
 Set height of the scalar image used for texturing the surface. More...
 
virtual void SetInput (Image *distanceImage)
 Sets the input of this filter. More...
 
virtual void SetInput (Image *distanceImage, mitk::CameraIntrinsics::Pointer cameraIntrinsics)
 Sets the input of this filter and the intrinsic parameters. More...
 
virtual void SetInput (unsigned int idx, Image *distanceImage)
 Sets the input of this filter at idx. More...
 
virtual void SetInput (unsigned int idx, Image *distanceImage, mitk::CameraIntrinsics::Pointer cameraIntrinsics)
 Sets the input of this filter at idx and the intrinsic parameters. More...
 
ImageGetInput ()
 Returns the input of this filter. More...
 
ImageGetInput (unsigned int idx)
 Returns the input with id idx of this filter. More...
 
- Public Member Functions inherited from mitk::SurfaceSource
virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
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 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

 ToFDistanceImageToSurfaceFilter ()
 Standard constructor. More...
 
 ~ToFDistanceImageToSurfaceFilter () override
 Standard destructor. More...
 
void GenerateOutputInformation () override
 
void GenerateData () override
 Method generating the output of this filter. Called in the updated process of the pipeline. This method generates the output of the ToFSurfaceSource: The generated surface of the 3d points. More...
 
void CreateOutputsForAllInputs ()
 Create an output for each input. More...
 
- Protected Member Functions inherited from mitk::SurfaceSource
 SurfaceSource ()
 
 ~SurfaceSource () override
 
- Protected Member Functions inherited from mitk::BaseDataSource
 BaseDataSource ()
 
 ~BaseDataSource () override
 

Protected Attributes

IplImage * m_IplScalarImage
 Scalar image used for surface texturing. More...
 
mitk::CameraIntrinsics::Pointer m_CameraIntrinsics
 Specifies the intrinsic parameters. More...
 
int m_TextureImageWidth
 Width (x-dimension) of the texture image. More...
 
int m_TextureImageHeight
 Height (y-dimension) of the texture image. More...
 
ToFProcessingCommon::ToFPoint2D m_InterPixelDistance
 distance in mm between two adjacent pixels on the ToF camera chip More...
 
int m_TextureIndex
 Index of the input used as texture image when no scalar image was set via SetIplScalarImage(). 0 = Distance, 1 = Amplitude, 2 = Intensity. More...
 
bool m_GenerateTriangularMesh
 
ReconstructionModeType m_ReconstructionMode
 The ReconstructionModeType enum: Defines the reconstruction mode, if using no interpixeldistances and focal lenghts in pixel units or interpixeldistances and focal length in mm. The Kinect option defines a special reconstruction mode for the kinect. More...
 
vtkSmartPointer< vtkIdList > m_VertexIdList
 Make a vtkIdList to save the ID's of the polyData corresponding to the image pixel ID's. This can be accessed after generate data to obtain the mapping. More...
 
double m_TriangulationThreshold
 

Additional Inherited Members

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

Detailed Description

Converts a Time-of-Flight (ToF) distance image to a 3D surface using the pinhole camera model for coordinate computation. The intrinsic parameters of the camera (FocalLength, PrincipalPoint, InterPixelDistance) are set via SetCameraIntrinsics(). The measured distance for each pixel corresponds to the distance between the object point and the corresponding image point on the image plane.

The coordinate conversion follows the model of a common pinhole camera where the origin of the camera coordinate system (world coordinates) is at the pinhole

The definition of the image plane and its coordinate systems (pixel and mm) is depicted in the following image

Definition at line 46 of file mitkToFDistanceImageToSurfaceFilter.h.

Member Enumeration Documentation

◆ ReconstructionModeType

The ReconstructionModeType enum: Defines the reconstruction mode, if using no interpixeldistances and focal lenghts in pixel units or interpixeldistances and focal length in mm. The Kinect option defines a special reconstruction mode for the kinect.

Enumerator
WithOutInterPixelDistance 
WithInterPixelDistance 
Kinect 

Definition at line 84 of file mitkToFDistanceImageToSurfaceFilter.h.

Constructor & Destructor Documentation

◆ ToFDistanceImageToSurfaceFilter()

mitk::ToFDistanceImageToSurfaceFilter::ToFDistanceImageToSurfaceFilter ( )
protected

Standard constructor.

◆ ~ToFDistanceImageToSurfaceFilter()

mitk::ToFDistanceImageToSurfaceFilter::~ToFDistanceImageToSurfaceFilter ( )
overrideprotected

Standard destructor.

Member Function Documentation

◆ Clone()

Pointer mitk::ToFDistanceImageToSurfaceFilter::Clone ( ) const

◆ CreateOutputsForAllInputs()

void mitk::ToFDistanceImageToSurfaceFilter::CreateOutputsForAllInputs ( )
protected

Create an output for each input.

This Method sets the number of outputs to the number of inputs and creates missing outputs objects.

Warning
any additional outputs that exist before the method is called are deleted

◆ GenerateData()

void mitk::ToFDistanceImageToSurfaceFilter::GenerateData ( )
overrideprotected

Method generating the output of this filter. Called in the updated process of the pipeline. This method generates the output of the ToFSurfaceSource: The generated surface of the 3d points.

◆ GenerateOutputInformation()

void mitk::ToFDistanceImageToSurfaceFilter::GenerateOutputInformation ( )
overrideprotected

◆ GetCameraIntrinsics()

virtual mitk::CameraIntrinsics::Pointer mitk::ToFDistanceImageToSurfaceFilter::GetCameraIntrinsics ( )
virtual

◆ GetGenerateTriangularMesh()

virtual bool mitk::ToFDistanceImageToSurfaceFilter::GetGenerateTriangularMesh ( )
virtual

◆ GetInput() [1/2]

Image* mitk::ToFDistanceImageToSurfaceFilter::GetInput ( )

Returns the input of this filter.

◆ GetInput() [2/2]

Image* mitk::ToFDistanceImageToSurfaceFilter::GetInput ( unsigned int  idx)

Returns the input with id idx of this filter.

◆ GetInterPixelDistance()

virtual ToFProcessingCommon::ToFPoint2D mitk::ToFDistanceImageToSurfaceFilter::GetInterPixelDistance ( )
virtual

◆ GetScalarImage()

IplImage* mitk::ToFDistanceImageToSurfaceFilter::GetScalarImage ( )

Set scalar image used as texture of the surface.

Returns
OpenCV image for texturing

◆ GetTriangulationThreshold()

virtual double mitk::ToFDistanceImageToSurfaceFilter::GetTriangulationThreshold ( )
virtual

◆ GetVertexIdList()

virtual vtkSmartPointer<vtkIdList> mitk::ToFDistanceImageToSurfaceFilter::GetVertexIdList ( )
virtual

◆ itkGetEnumMacro()

mitk::ToFDistanceImageToSurfaceFilter::itkGetEnumMacro ( ReconstructionMode  ,
ReconstructionModeType   
)

◆ itkSetEnumMacro()

mitk::ToFDistanceImageToSurfaceFilter::itkSetEnumMacro ( ReconstructionMode  ,
ReconstructionModeType   
)

◆ mitkClassMacro()

mitk::ToFDistanceImageToSurfaceFilter::mitkClassMacro ( ToFDistanceImageToSurfaceFilter  ,
SurfaceSource   
)

◆ New()

static Pointer mitk::ToFDistanceImageToSurfaceFilter::New ( )
static

◆ SetCameraIntrinsics()

virtual void mitk::ToFDistanceImageToSurfaceFilter::SetCameraIntrinsics ( mitk::CameraIntrinsics::Pointer  _arg)
virtual

◆ SetGenerateTriangularMesh()

virtual void mitk::ToFDistanceImageToSurfaceFilter::SetGenerateTriangularMesh ( bool  _arg)
virtual

◆ SetInput() [1/4]

virtual void mitk::ToFDistanceImageToSurfaceFilter::SetInput ( Image distanceImage)
virtual

Sets the input of this filter.

Parameters
distanceImageinput is the distance image of e.g. a ToF camera

◆ SetInput() [2/4]

virtual void mitk::ToFDistanceImageToSurfaceFilter::SetInput ( Image distanceImage,
mitk::CameraIntrinsics::Pointer  cameraIntrinsics 
)
virtual

Sets the input of this filter and the intrinsic parameters.

Parameters
distanceImageinput is the distance image of e.g. a ToF camera
cameraIntrinsics

◆ SetInput() [3/4]

virtual void mitk::ToFDistanceImageToSurfaceFilter::SetInput ( unsigned int  idx,
Image distanceImage 
)
virtual

Sets the input of this filter at idx.

Parameters
idxnumber of the current input
distanceImageinput is the distance image of e.g. a ToF camera

◆ SetInput() [4/4]

virtual void mitk::ToFDistanceImageToSurfaceFilter::SetInput ( unsigned int  idx,
Image distanceImage,
mitk::CameraIntrinsics::Pointer  cameraIntrinsics 
)
virtual

Sets the input of this filter at idx and the intrinsic parameters.

Parameters
idxnumber of the current input
distanceImageinput is the distance image of e.g. a ToF camera
cameraIntrinsicsThis is the camera model which holds parameters like focal length, pixel size, etc. which are needed for the reconstruction of the surface.

◆ SetInterPixelDistance()

virtual void mitk::ToFDistanceImageToSurfaceFilter::SetInterPixelDistance ( ToFProcessingCommon::ToFPoint2D  _arg)
virtual

◆ SetScalarImage()

void mitk::ToFDistanceImageToSurfaceFilter::SetScalarImage ( IplImage *  iplScalarImage)

Set scalar image used as texture of the surface.

Parameters
iplScalarImageOpenCV image for texturing

◆ SetTextureImageHeight()

void mitk::ToFDistanceImageToSurfaceFilter::SetTextureImageHeight ( int  height)

Set height of the scalar image used for texturing the surface.

Parameters
heightheight (y-dimension) of the texture image

◆ SetTextureImageWidth()

void mitk::ToFDistanceImageToSurfaceFilter::SetTextureImageWidth ( int  width)

Set width of the scalar image used for texturing the surface.

Parameters
widthwidth (x-dimension) of the texture image

◆ SetTextureIndex()

virtual void mitk::ToFDistanceImageToSurfaceFilter::SetTextureIndex ( int  _arg)
virtual

◆ SetTriangulationThreshold()

void mitk::ToFDistanceImageToSurfaceFilter::SetTriangulationThreshold ( double  triangulationThreshold)

SetTriangulationThreshold Sets a triangulation threshold in order to remove unusually huge faces from the surface. If this value is set, the filter will check whether the distance between two neighboring vertices exceeds the triangulation threshold. If yes, there vertices will not be triangulated (connected with lines). The vertices will still be added to the surface, but only as single point (if they have no other neighbors).

Parameters
triangulationThresholdThe triangulationThreshold in mm. (not mm*mm!)
Note
vtkMath::Distance2BetweenPoints returns the squared distance between two points and hence we square m_TriangulationThreshold in order to save run-time.

◆ SetVertexIdList()

virtual void mitk::ToFDistanceImageToSurfaceFilter::SetVertexIdList ( vtkSmartPointer< vtkIdList >  _arg)
virtual

Member Data Documentation

◆ m_CameraIntrinsics

mitk::CameraIntrinsics::Pointer mitk::ToFDistanceImageToSurfaceFilter::m_CameraIntrinsics
protected

Specifies the intrinsic parameters.

Definition at line 175 of file mitkToFDistanceImageToSurfaceFilter.h.

◆ m_GenerateTriangularMesh

bool mitk::ToFDistanceImageToSurfaceFilter::m_GenerateTriangularMesh
protected

Definition at line 182 of file mitkToFDistanceImageToSurfaceFilter.h.

◆ m_InterPixelDistance

ToFProcessingCommon::ToFPoint2D mitk::ToFDistanceImageToSurfaceFilter::m_InterPixelDistance
protected

distance in mm between two adjacent pixels on the ToF camera chip

Definition at line 179 of file mitkToFDistanceImageToSurfaceFilter.h.

◆ m_IplScalarImage

IplImage* mitk::ToFDistanceImageToSurfaceFilter::m_IplScalarImage
protected

Scalar image used for surface texturing.

Definition at line 173 of file mitkToFDistanceImageToSurfaceFilter.h.

◆ m_ReconstructionMode

ReconstructionModeType mitk::ToFDistanceImageToSurfaceFilter::m_ReconstructionMode
protected

The ReconstructionModeType enum: Defines the reconstruction mode, if using no interpixeldistances and focal lenghts in pixel units or interpixeldistances and focal length in mm. The Kinect option defines a special reconstruction mode for the kinect.

Definition at line 184 of file mitkToFDistanceImageToSurfaceFilter.h.

◆ m_TextureImageHeight

int mitk::ToFDistanceImageToSurfaceFilter::m_TextureImageHeight
protected

Height (y-dimension) of the texture image.

Definition at line 178 of file mitkToFDistanceImageToSurfaceFilter.h.

◆ m_TextureImageWidth

int mitk::ToFDistanceImageToSurfaceFilter::m_TextureImageWidth
protected

Width (x-dimension) of the texture image.

Definition at line 177 of file mitkToFDistanceImageToSurfaceFilter.h.

◆ m_TextureIndex

int mitk::ToFDistanceImageToSurfaceFilter::m_TextureIndex
protected

Index of the input used as texture image when no scalar image was set via SetIplScalarImage(). 0 = Distance, 1 = Amplitude, 2 = Intensity.

Definition at line 181 of file mitkToFDistanceImageToSurfaceFilter.h.

◆ m_TriangulationThreshold

double mitk::ToFDistanceImageToSurfaceFilter::m_TriangulationThreshold
protected

Definition at line 188 of file mitkToFDistanceImageToSurfaceFilter.h.

◆ m_VertexIdList

vtkSmartPointer<vtkIdList> mitk::ToFDistanceImageToSurfaceFilter::m_VertexIdList
protected

Make a vtkIdList to save the ID's of the polyData corresponding to the image pixel ID's. This can be accessed after generate data to obtain the mapping.

Definition at line 186 of file mitkToFDistanceImageToSurfaceFilter.h.


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