Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::ToFCameraMESAController Class Referenceabstract

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

#include <mitkToFCameraMESAController.h>

Inheritance diagram for mitk::ToFCameraMESAController:
Collaboration diagram for mitk::ToFCameraMESAController:

Public Member Functions

 mitkClassMacroItkParent (ToFCameraMESAController, 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 GetIntensities (float *intensityArray)
 Gets the current intensity array from the device. More...
 
virtual bool GetDistances (float *distanceArray)
 Gets the current distance array from the device. More...
 
virtual bool UpdateCamera ()
 calls update on the camera -> a new ToF-image is aquired More...
 
virtual int GetModulationFrequency ()=0
 Returns the currently set modulation frequency. More...
 
virtual int SetModulationFrequency (unsigned int modulationFrequency)=0
 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 ()=0
 Returns the currently set integration time. More...
 
virtual int SetIntegrationTime (unsigned int integrationTime)=0
 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 MESA 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...
 

Protected Member Functions

 ToFCameraMESAController ()
 
 ~ToFCameraMESAController ()
 
bool ErrorText (int error)
 Method printing the current error message to the console and returning whether the previous command was successful. More...
 

Protected Attributes

char m_MESAError [128]
 member holding the current error text More...
 
int m_MESARes
 holds the current result message provided by MESA 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 More...
 
unsigned int m_CaptureHeight
 holds the height of the image in pixel More...
 
int m_NumImg
 holds the number of images the camera provided (distance, intensity, etc) More...
 
float m_MaxRangeFactor
 holds the factor to calculate the real distance depends on the modulation frequency 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 MESA player classes More...
 

Detailed Description

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

Definition at line 34 of file mitkToFCameraMESAController.h.

Constructor & Destructor Documentation

mitk::ToFCameraMESAController::ToFCameraMESAController ( )
protected

Definition at line 24 of file mitkToFCameraMESAController.cpp.

mitk::ToFCameraMESAController::~ToFCameraMESAController ( )
protected

Definition at line 30 of file mitkToFCameraMESAController.cpp.

Member Function Documentation

bool mitk::ToFCameraMESAController::CloseCameraConnection ( )
virtual

closes the connection to the camera

Definition at line 34 of file mitkToFCameraMESAController.cpp.

References ErrorText(), m_ConnectionCheck, m_MESAHandle, and m_MESARes.

bool mitk::ToFCameraMESAController::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 MESA function
Returns
flag indicating if an error occured (false) or not (true)

Definition at line 42 of file mitkToFCameraMESAController.cpp.

Referenced by CloseCameraConnection(), and mitk::ToFCameraMESASR4000Controller::OpenCameraConnection().

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

Gets the current amplitude array from the device.

Parameters
amplitudeArrayfloat array where the amplitude data will be saved

Definition at line 61 of file mitkToFCameraMESAController.cpp.

References m_MESAHandle, and m_PixelNumber.

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

Access the resolution of the image in y direction.

Returns
height of image in pixel
virtual unsigned int mitk::ToFCameraMESAController::GetCaptureWidth ( )
virtual

Access the resolution of the image in x direction.

Returns
widht of image in pixel
bool mitk::ToFCameraMESAController::GetDistances ( float *  distanceArray)
virtual

Gets the current distance array from the device.

Parameters
distanceArrayfloat array where the distance data will be saved

Definition at line 92 of file mitkToFCameraMESAController.cpp.

References m_MaxRangeFactor, m_MESAHandle, and m_PixelNumber.

virtual int mitk::ToFCameraMESAController::GetIntegrationTime ( )
pure virtual

Returns the currently set integration time.

Returns
integration time

Implemented in mitk::ToFCameraMESASR4000Controller.

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

Gets the current intensity array from the device.

Parameters
intensityArrayfloat array where the intensity data will be saved

Definition at line 81 of file mitkToFCameraMESAController.cpp.

References m_MESAHandle, and m_PixelNumber.

virtual int mitk::ToFCameraMESAController::GetModulationFrequency ( )
pure virtual

Returns the currently set modulation frequency.

Returns
modulation frequency

Implemented in mitk::ToFCameraMESASR4000Controller.

mitk::ToFCameraMESAController::mitkClassMacroItkParent ( ToFCameraMESAController  ,
itk::Object   
)
virtual bool mitk::ToFCameraMESAController::OpenCameraConnection ( )
pure virtual

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

Implemented in mitk::ToFCameraMESASR4000Controller.

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

set input file name used by MESA player classes

Definition at line 119 of file mitkToFCameraMESAController.cpp.

References m_InputFileName.

virtual int mitk::ToFCameraMESAController::SetIntegrationTime ( unsigned int  integrationTime)
pure 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

Implemented in mitk::ToFCameraMESASR4000Controller.

virtual int mitk::ToFCameraMESAController::SetModulationFrequency ( unsigned int  modulationFrequency)
pure 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

Implemented in mitk::ToFCameraMESASR4000Controller.

bool mitk::ToFCameraMESAController::UpdateCamera ( )
virtual

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

Definition at line 54 of file mitkToFCameraMESAController.cpp.

References m_MESAHandle, and m_MESARes.

Member Data Documentation

unsigned int mitk::ToFCameraMESAController::m_CaptureHeight
protected

holds the height of the image in pixel

Definition at line 127 of file mitkToFCameraMESAController.h.

Referenced by mitk::ToFCameraMESASR4000Controller::OpenCameraConnection().

unsigned int mitk::ToFCameraMESAController::m_CaptureWidth
protected

holds the width of the image in pixel

Definition at line 126 of file mitkToFCameraMESAController.h.

Referenced by mitk::ToFCameraMESASR4000Controller::OpenCameraConnection().

bool mitk::ToFCameraMESAController::m_ConnectionCheck
protected

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

Definition at line 133 of file mitkToFCameraMESAController.h.

Referenced by CloseCameraConnection(), and mitk::ToFCameraMESASR4000Controller::OpenCameraConnection().

std::string mitk::ToFCameraMESAController::m_InputFileName
protected

input file name used by MESA player classes

Definition at line 135 of file mitkToFCameraMESAController.h.

Referenced by SetInputFileName().

float mitk::ToFCameraMESAController::m_MaxRangeFactor
protected
char mitk::ToFCameraMESAController::m_MESAError[128]
protected

member holding the current error text

Definition at line 121 of file mitkToFCameraMESAController.h.

int mitk::ToFCameraMESAController::m_NumberOfBytes
protected

holds the number of bytes contained in the image

Definition at line 125 of file mitkToFCameraMESAController.h.

Referenced by mitk::ToFCameraMESASR4000Controller::OpenCameraConnection().

int mitk::ToFCameraMESAController::m_NumImg
protected

holds the number of images the camera provided (distance, intensity, etc)

Definition at line 129 of file mitkToFCameraMESAController.h.

Referenced by mitk::ToFCameraMESASR4000Controller::OpenCameraConnection().

int mitk::ToFCameraMESAController::m_PixelNumber
protected

holds the number of pixels contained in the image

Definition at line 124 of file mitkToFCameraMESAController.h.

Referenced by GetAmplitudes(), GetDistances(), GetIntensities(), and mitk::ToFCameraMESASR4000Controller::OpenCameraConnection().


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