Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitk::ToFCameraPMDController Class Referenceabstract

Virtual interface and base class for all PMD Time-of-Flight devices. Wraps PMD API provided in PMDSDK2 Provides methods for accessing current distance, amplitude, intensity and raw data. Allows to set parameters like modulation frequency and integration time. More...

#include <mitkToFCameraPMDController.h>

Inheritance diagram for mitk::ToFCameraPMDController:
Collaboration diagram for mitk::ToFCameraPMDController:

Public Member Functions

 mitkClassMacroItkParent (ToFCameraPMDController, itk::Object)
 
virtual bool OpenCameraConnection ()=0
 opens a connection to the ToF camera. Has to be implemented by the sub class More...
 
virtual bool CloseCameraConnection ()
 closes the connection to the camera More...
 
virtual bool GetAmplitudes (float *amplitudeArray)
 Gets the current amplitude array from the device. More...
 
virtual bool GetAmplitudes (char *sourceData, float *amplitudeArray)
 Calculates the current amplitude data from the raw source data using the processing plugin of the PMDSDK. More...
 
virtual bool GetIntensities (float *intensityArray)
 Gets the current intensity array from the device. More...
 
virtual bool GetIntensities (char *sourceData, float *intensityArray)
 Calculates the current intensity data from the raw source data using the processing plugin of the PMDSDK. More...
 
virtual bool GetDistances (float *distanceArray)
 Gets the current distance array from the device. More...
 
virtual bool GetDistances (char *sourceData, float *distanceArray)
 Calculates the current distance data from the raw source data using the processing plugin of the PMDSDK. More...
 
virtual bool GetSourceData (char *sourceDataArray)
 Gets the PMD raw data from the ToF device. More...
 
bool GetShortSourceData (short *sourceData)
 Convenience method to get the PMD raw data from the ToF device as short array. More...
 
virtual bool UpdateCamera ()
 calls update on the camera -> a new ToF-image is aquired More...
 
virtual int GetModulationFrequency ()
 Returns the currently set modulation frequency. More...
 
virtual int SetModulationFrequency (unsigned int modulationFrequency)
 Sets the modulation frequency of the ToF device. The method automatically calculates a valid value from the given frequency to make sure that only valid frequencies are used. More...
 
virtual int GetIntegrationTime ()
 Returns the currently set integration time. More...
 
virtual int SetIntegrationTime (unsigned int integrationTime)
 Sets the integration time of the ToF device. The method automatically calculates a valid value from the given integration time to make sure that only valid times are used. More...
 
virtual void SetInputFileName (std::string inputFileName)
 set input file name used by PMD player classes More...
 
virtual unsigned int GetCaptureWidth ()
 Access the resolution of the image in x direction. More...
 
virtual unsigned int GetCaptureHeight ()
 Access the resolution of the image in y direction. More...
 
virtual unsigned int GetInternalCaptureWidth ()
 Access the chosen width of the resulting image in x direction. More...
 
virtual unsigned int GetInternalCaptureHeight ()
 Access the chosen width of the resulting image in y direction. More...
 
virtual int GetSourceDataStructSize ()
 

Protected Member Functions

 ToFCameraPMDController ()
 
 ~ToFCameraPMDController ()
 
bool ErrorText (int error)
 Method printing the current error message to the console and returning whether the previous command was successful. More...
 
virtual void TransformCameraOutput (float *in, float *out, bool isDist)=0
 

Protected Attributes

char m_PMDError [128]
 member holding the current error text More...
 
int m_PMDRes
 holds the current result message provided by PMD More...
 
int m_PixelNumber
 holds the number of pixels contained in the image More...
 
int m_NumberOfBytes
 holds the number of bytes contained in the image More...
 
unsigned int m_CaptureWidth
 holds the width of the image in pixel as it is originally acquired by the camera More...
 
unsigned int m_CaptureHeight
 holds the height of the image in pixel as it is originally acquired by the camera More...
 
unsigned int m_InternalCaptureWidth
 holds the width of the image in pixel as it is requested by the user (cf. TransformCameraOutput()) Default: m_CaptureWidth More...
 
unsigned int m_InternalCaptureHeight
 holds the height of the image in pixel as is it requested by the user (cf. TransformCameraOutput()) Default: m_CaptureHeight More...
 
int m_SourceDataSize
 size of the original PMD source data More...
 
int m_SourceDataStructSize
 size of the PMD source data struct and the PMD source data More...
 
bool m_ConnectionCheck
 flag showing whether the camera is connected (true) or not (false) More...
 
std::string m_InputFileName
 input file name used by PMD player classes More...
 
char * m_SourcePlugin
 holds name of source plugin to be loaded (e.g. camcube3.W64.pap for CamCube 3.0 on Win64 platform) More...
 
char * m_SourceParam
 holds source parameter(s) More...
 
char * m_ProcPlugin
 holds name of processing plugin to be loaded (e.g. camcubeproc.W64.pap for CamCube 3.0 on Win64 platform) More...
 
char * m_ProcParam
 holds processing parameter(s) More...
 

Detailed Description

Virtual interface and base class for all PMD Time-of-Flight devices. Wraps PMD API provided in PMDSDK2 Provides methods for accessing current distance, amplitude, intensity and raw data. Allows to set parameters like modulation frequency and integration time.

Definition at line 31 of file mitkToFCameraPMDController.h.

Constructor & Destructor Documentation

◆ ToFCameraPMDController()

mitk::ToFCameraPMDController::ToFCameraPMDController ( )
protected

◆ ~ToFCameraPMDController()

mitk::ToFCameraPMDController::~ToFCameraPMDController ( )
protected

Member Function Documentation

◆ CloseCameraConnection()

virtual bool mitk::ToFCameraPMDController::CloseCameraConnection ( )
virtual

closes the connection to the camera

◆ ErrorText()

bool mitk::ToFCameraPMDController::ErrorText ( int  error)
protected

Method printing the current error message to the console and returning whether the previous command was successful.

Parameters
errorerror number returned by the PMD function
Returns
flag indicating if an error occured (false) or not (true)

◆ GetAmplitudes() [1/2]

virtual bool mitk::ToFCameraPMDController::GetAmplitudes ( char *  sourceData,
float *  amplitudeArray 
)
virtual

Calculates the current amplitude data from the raw source data using the processing plugin of the PMDSDK.

Parameters
sourceDataraw data array
amplitudeArrayfloat array where the amplitude data will be saved

◆ GetAmplitudes() [2/2]

virtual bool mitk::ToFCameraPMDController::GetAmplitudes ( float *  amplitudeArray)
virtual

Gets the current amplitude array from the device.

Parameters
amplitudeArrayfloat array where the amplitude data will be saved

◆ GetCaptureHeight()

virtual unsigned int mitk::ToFCameraPMDController::GetCaptureHeight ( )
virtual

Access the resolution of the image in y direction.

Returns
height of image in pixel

◆ GetCaptureWidth()

virtual unsigned int mitk::ToFCameraPMDController::GetCaptureWidth ( )
virtual

Access the resolution of the image in x direction.

Returns
widht of image in pixel

◆ GetDistances() [1/2]

virtual bool mitk::ToFCameraPMDController::GetDistances ( char *  sourceData,
float *  distanceArray 
)
virtual

Calculates the current distance data from the raw source data using the processing plugin of the PMDSDK.

Parameters
sourceDataraw data array
distanceArrayfloat array where the distance data will be saved

◆ GetDistances() [2/2]

virtual bool mitk::ToFCameraPMDController::GetDistances ( float *  distanceArray)
virtual

Gets the current distance array from the device.

Parameters
distanceArrayfloat array where the distance data will be saved

◆ GetIntegrationTime()

virtual int mitk::ToFCameraPMDController::GetIntegrationTime ( )
virtual

Returns the currently set integration time.

Returns
integration time

◆ GetIntensities() [1/2]

virtual bool mitk::ToFCameraPMDController::GetIntensities ( char *  sourceData,
float *  intensityArray 
)
virtual

Calculates the current intensity data from the raw source data using the processing plugin of the PMDSDK.

Parameters
sourceDataraw data array
intensityArrayfloat array where the intensity data will be saved

◆ GetIntensities() [2/2]

virtual bool mitk::ToFCameraPMDController::GetIntensities ( float *  intensityArray)
virtual

Gets the current intensity array from the device.

Parameters
intensityArrayfloat array where the intensity data will be saved

◆ GetInternalCaptureHeight()

virtual unsigned int mitk::ToFCameraPMDController::GetInternalCaptureHeight ( )
virtual

Access the chosen width of the resulting image in y direction.

Returns
height of image in pixel

◆ GetInternalCaptureWidth()

virtual unsigned int mitk::ToFCameraPMDController::GetInternalCaptureWidth ( )
virtual

Access the chosen width of the resulting image in x direction.

Returns
widht of image in pixel

◆ GetModulationFrequency()

virtual int mitk::ToFCameraPMDController::GetModulationFrequency ( )
virtual

Returns the currently set modulation frequency.

Returns
modulation frequency

◆ GetShortSourceData()

bool mitk::ToFCameraPMDController::GetShortSourceData ( short *  sourceData)

Convenience method to get the PMD raw data from the ToF device as short array.

Parameters
sourceDataarray where the short raw data will be saved

◆ GetSourceData()

virtual bool mitk::ToFCameraPMDController::GetSourceData ( char *  sourceDataArray)
virtual

Gets the PMD raw data from the ToF device.

Parameters
sourceDataArrayarray where the raw data will be saved

◆ GetSourceDataStructSize()

virtual int mitk::ToFCameraPMDController::GetSourceDataStructSize ( )
virtual

◆ mitkClassMacroItkParent()

mitk::ToFCameraPMDController::mitkClassMacroItkParent ( ToFCameraPMDController  ,
itk::Object   
)

◆ OpenCameraConnection()

virtual bool mitk::ToFCameraPMDController::OpenCameraConnection ( )
pure virtual

opens a connection to the ToF camera. Has to be implemented by the sub class

Exceptions
mitkExceptionIn case of no connection, an exception is thrown!

Implemented in mitk::ToFCameraPMDPlayerController, mitk::ToFCameraPMDCamBoardController, mitk::ToFCameraPMDCamCubeController, and mitk::ToFCameraPMDO3Controller.

◆ SetInputFileName()

virtual void mitk::ToFCameraPMDController::SetInputFileName ( std::string  inputFileName)
virtual

set input file name used by PMD player classes

◆ SetIntegrationTime()

virtual int mitk::ToFCameraPMDController::SetIntegrationTime ( unsigned int  integrationTime)
virtual

Sets the integration time of the ToF device. The method automatically calculates a valid value from the given integration time to make sure that only valid times are used.

Parameters
integrationTimeintegration time
Returns
integration time set after validation step

Reimplemented in mitk::ToFCameraPMDPlayerController.

◆ SetModulationFrequency()

virtual int mitk::ToFCameraPMDController::SetModulationFrequency ( unsigned int  modulationFrequency)
virtual

Sets the modulation frequency of the ToF device. The method automatically calculates a valid value from the given frequency to make sure that only valid frequencies are used.

Parameters
modulationFrequencymodulation frequency
Returns
frequency set after validation step

Reimplemented in mitk::ToFCameraPMDPlayerController.

◆ TransformCameraOutput()

virtual void mitk::ToFCameraPMDController::TransformCameraOutput ( float *  in,
float *  out,
bool  isDist 
)
protectedpure virtual

◆ UpdateCamera()

virtual bool mitk::ToFCameraPMDController::UpdateCamera ( )
virtual

calls update on the camera -> a new ToF-image is aquired

Exceptions
mitkExceptionIn case of no connection, an exception is thrown!

Member Data Documentation

◆ m_CaptureHeight

unsigned int mitk::ToFCameraPMDController::m_CaptureHeight
protected

holds the height of the image in pixel as it is originally acquired by the camera

Definition at line 175 of file mitkToFCameraPMDController.h.

◆ m_CaptureWidth

unsigned int mitk::ToFCameraPMDController::m_CaptureWidth
protected

holds the width of the image in pixel as it is originally acquired by the camera

Definition at line 174 of file mitkToFCameraPMDController.h.

◆ m_ConnectionCheck

bool mitk::ToFCameraPMDController::m_ConnectionCheck
protected

flag showing whether the camera is connected (true) or not (false)

Definition at line 182 of file mitkToFCameraPMDController.h.

◆ m_InputFileName

std::string mitk::ToFCameraPMDController::m_InputFileName
protected

input file name used by PMD player classes

Definition at line 184 of file mitkToFCameraPMDController.h.

◆ m_InternalCaptureHeight

unsigned int mitk::ToFCameraPMDController::m_InternalCaptureHeight
protected

holds the height of the image in pixel as is it requested by the user (cf. TransformCameraOutput()) Default: m_CaptureHeight

Definition at line 177 of file mitkToFCameraPMDController.h.

◆ m_InternalCaptureWidth

unsigned int mitk::ToFCameraPMDController::m_InternalCaptureWidth
protected

holds the width of the image in pixel as it is requested by the user (cf. TransformCameraOutput()) Default: m_CaptureWidth

Definition at line 176 of file mitkToFCameraPMDController.h.

◆ m_NumberOfBytes

int mitk::ToFCameraPMDController::m_NumberOfBytes
protected

holds the number of bytes contained in the image

Definition at line 173 of file mitkToFCameraPMDController.h.

◆ m_PixelNumber

int mitk::ToFCameraPMDController::m_PixelNumber
protected

holds the number of pixels contained in the image

Definition at line 172 of file mitkToFCameraPMDController.h.

◆ m_PMDError

char mitk::ToFCameraPMDController::m_PMDError[128]
protected

member holding the current error text

Definition at line 169 of file mitkToFCameraPMDController.h.

◆ m_PMDRes

int mitk::ToFCameraPMDController::m_PMDRes
protected

holds the current result message provided by PMD

Definition at line 170 of file mitkToFCameraPMDController.h.

◆ m_ProcParam

char* mitk::ToFCameraPMDController::m_ProcParam
protected

holds processing parameter(s)

Definition at line 189 of file mitkToFCameraPMDController.h.

◆ m_ProcPlugin

char* mitk::ToFCameraPMDController::m_ProcPlugin
protected

holds name of processing plugin to be loaded (e.g. camcubeproc.W64.pap for CamCube 3.0 on Win64 platform)

Definition at line 188 of file mitkToFCameraPMDController.h.

◆ m_SourceDataSize

int mitk::ToFCameraPMDController::m_SourceDataSize
protected

size of the original PMD source data

Definition at line 179 of file mitkToFCameraPMDController.h.

◆ m_SourceDataStructSize

int mitk::ToFCameraPMDController::m_SourceDataStructSize
protected

size of the PMD source data struct and the PMD source data

Definition at line 180 of file mitkToFCameraPMDController.h.

◆ m_SourceParam

char* mitk::ToFCameraPMDController::m_SourceParam
protected

holds source parameter(s)

Definition at line 187 of file mitkToFCameraPMDController.h.

◆ m_SourcePlugin

char* mitk::ToFCameraPMDController::m_SourcePlugin
protected

holds name of source plugin to be loaded (e.g. camcube3.W64.pap for CamCube 3.0 on Win64 platform)

Definition at line 186 of file mitkToFCameraPMDController.h.


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