Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::ToFCameraMITKPlayerDevice Class Reference

Device class representing a player for MITK-ToF images. More...

#include <mitkToFCameraMITKPlayerDevice.h>

Inheritance diagram for mitk::ToFCameraMITKPlayerDevice:
Collaboration diagram for mitk::ToFCameraMITKPlayerDevice:

Public Member Functions

 mitkClassMacro (ToFCameraMITKPlayerDevice, ToFCameraDevice)
 
Pointer Clone () const
 
virtual bool OnConnectCamera () override
 opens a connection to the ToF camera More...
 
virtual bool DisconnectCamera () override
 closes the connection to the camera More...
 
virtual void StartCamera () override
 starts the continuous updating of the camera. A separate thread updates the source data, the main thread processes the source data and creates images and coordinates More...
 
virtual void GetAmplitudes (float *amplitudeArray, int &imageSequence) override
 gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel. Caution! The user is responsible for allocating and deleting the images. These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value More...
 
virtual void GetIntensities (float *intensityArray, int &imageSequence) override
 gets the intensity data from the ToF camera as a greyscale image. Caution! The user is responsible for allocating and deleting the images. More...
 
virtual void GetRgb (unsigned char *rgbArray, int &imageSequence)
 gets the rgb data from the ToF camera. Caution! The user is responsible for allocating and deleting the images. More...
 
virtual void GetDistances (float *distanceArray, int &imageSequence) override
 gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters. Caution! The user is responsible for allocating and deleting the images. More...
 
virtual void GetAllImages (float *distanceArray, float *amplitudeArray, float *intensityArray, char *sourceDataArray, int requiredImageSequence, int &capturedImageSequence, unsigned char *rgbDataArray=NULL) override
 gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images. More...
 
virtual void SetInputFileName (std::string inputFileName)
 Set file name where the data is recorded. More...
 
virtual void SetProperty (const char *propertyKey, BaseProperty *propertyValue) override
 set a BaseProperty More...
 
- Public Member Functions inherited from mitk::ToFCameraDevice
 mitkClassMacroItkParent (ToFCameraDevice, itk::Object)
 
virtual bool ConnectCamera ()
 ConnectCamera Internally calls OnConnectCamera() of the respective device implementation. More...
 
virtual void StopCamera ()
 stops the continuous updating of the camera More...
 
virtual bool IsCameraActive ()
 returns true if the camera is connected and started More...
 
virtual bool IsCameraConnected ()
 returns true if the camera is connected More...
 
virtual int GetCaptureWidth ()
 get the currently set capture width More...
 
virtual int GetCaptureHeight ()
 get the currently set capture height More...
 
virtual int GetSourceDataSize ()
 get the currently set source data size More...
 
virtual int GetBufferSize ()
 get the currently set buffer size More...
 
virtual int GetMaxBufferSize ()
 get the currently set max buffer size More...
 
void SetBoolProperty (const char *propertyKey, bool boolValue)
 set a bool property in the property list More...
 
void SetIntProperty (const char *propertyKey, int intValue)
 set an int property in the property list More...
 
void SetFloatProperty (const char *propertyKey, float floatValue)
 set a float property in the property list More...
 
void SetStringProperty (const char *propertyKey, const char *stringValue)
 set a string property in the property list More...
 
virtual BasePropertyGetProperty (const char *propertyKey)
 get a BaseProperty from the property list More...
 
bool GetBoolProperty (const char *propertyKey, bool &boolValue)
 get a bool from the property list More...
 
bool GetStringProperty (const char *propertyKey, std::string &string)
 get a string from the property list More...
 
bool GetIntProperty (const char *propertyKey, int &integer)
 get an int from the property list More...
 
virtual int GetRGBCaptureWidth ()
 
virtual int GetRGBCaptureHeight ()
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 ToFCameraMITKPlayerDevice ()
 
 ~ToFCameraMITKPlayerDevice ()
 
virtual void UpdateCamera () override
 updates the camera for image acquisition More...
 
void CleanUpDataBuffers ()
 Clean up memory (pixel buffers) More...
 
void AllocateDataBuffers ()
 Allocate pixel buffers. More...
 
- Protected Member Functions inherited from mitk::ToFCameraDevice
 ToFCameraDevice ()
 
 ~ToFCameraDevice ()
 
virtual void AllocatePixelArrays ()
 method for allocating memory for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray More...
 
virtual void CleanupPixelArrays ()
 method for cleanup memory allocated for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray More...
 

Static Protected Member Functions

static ITK_THREAD_RETURN_TYPE Acquire (void *pInfoStruct)
 Thread method continuously acquiring images from the specified input file. More...
 

Protected Attributes

ToFCameraMITKPlayerController::Pointer m_Controller
 member holding the corresponding controller More...
 
std::string m_InputFileName
 member holding the file name of the current input file More...
 
- Protected Attributes inherited from mitk::ToFCameraDevice
float * m_IntensityArray
 float array holding the intensity image More...
 
float * m_DistanceArray
 float array holding the distance image More...
 
float * m_AmplitudeArray
 float array holding the amplitude image More...
 
int m_BufferSize
 buffer size of the image buffer needed for loss-less acquisition of range data More...
 
int m_MaxBufferSize
 maximal buffer size needed for initialization of data arrays. Default value is 100. More...
 
int m_CurrentPos
 current position in the buffer which will be retrieved by the Get methods More...
 
int m_FreePos
 current position in the buffer which will be filled with data acquired from the hardware More...
 
int m_CaptureWidth
 width of the range image (x dimension) More...
 
int m_CaptureHeight
 height of the range image (y dimension) More...
 
int m_PixelNumber
 number of pixels in the range image (m_CaptureWidth*m_CaptureHeight) More...
 
int m_RGBImageWidth
 width of the RGB image (x dimension) More...
 
int m_RGBImageHeight
 height of the RGB image (y dimension) More...
 
int m_RGBPixelNumber
 number of pixels in the range image (m_RGBImageWidth*m_RGBImageHeight) More...
 
int m_SourceDataSize
 size of the PMD source data More...
 
itk::MultiThreader::Pointer m_MultiThreader
 itk::MultiThreader used for thread handling More...
 
itk::FastMutexLock::Pointer m_ImageMutex
 mutex for images provided by the range camera More...
 
itk::FastMutexLock::Pointer m_CameraActiveMutex
 mutex for the cameraActive flag More...
 
int m_ThreadID
 ID of the started thread. More...
 
bool m_CameraActive
 flag indicating if the camera is currently active or not. Caution: thread safe access only! More...
 
bool m_CameraConnected
 flag indicating if the camera is successfully connected or not. Caution: thread safe access only! More...
 
int m_ImageSequence
 counter for acquired images More...
 
PropertyList::Pointer m_PropertyList
 a list of the corresponding properties More...
 

Detailed Description

Device class representing a player for MITK-ToF images.

Definition at line 37 of file mitkToFCameraMITKPlayerDevice.h.

Constructor & Destructor Documentation

mitk::ToFCameraMITKPlayerDevice::ToFCameraMITKPlayerDevice ( )
protected
mitk::ToFCameraMITKPlayerDevice::~ToFCameraMITKPlayerDevice ( )
protected

Definition at line 33 of file mitkToFCameraMITKPlayerDevice.cpp.

References CleanUpDataBuffers(), and DisconnectCamera().

Member Function Documentation

ITK_THREAD_RETURN_TYPE mitk::ToFCameraMITKPlayerDevice::Acquire ( void *  pInfoStruct)
staticprotected
void mitk::ToFCameraMITKPlayerDevice::AllocateDataBuffers ( )
protected
void mitk::ToFCameraMITKPlayerDevice::CleanUpDataBuffers ( )
protected

Clean up memory (pixel buffers)

Definition at line 320 of file mitkToFCameraMITKPlayerDevice.cpp.

References mitk::ToFCameraDevice::m_MaxBufferSize.

Referenced by AllocateDataBuffers(), and ~ToFCameraMITKPlayerDevice().

Pointer mitk::ToFCameraMITKPlayerDevice::Clone ( ) const
bool mitk::ToFCameraMITKPlayerDevice::DisconnectCamera ( )
overridevirtual

closes the connection to the camera

Implements mitk::ToFCameraDevice.

Definition at line 63 of file mitkToFCameraMITKPlayerDevice.cpp.

References mitk::ToFCameraDevice::m_CameraConnected, m_Controller, and mitk::ToFCameraDevice::m_PropertyList.

Referenced by ~ToFCameraMITKPlayerDevice().

void mitk::ToFCameraMITKPlayerDevice::GetAllImages ( float *  distanceArray,
float *  amplitudeArray,
float *  intensityArray,
char *  sourceDataArray,
int  requiredImageSequence,
int &  capturedImageSequence,
unsigned char *  rgbDataArray = NULL 
)
overridevirtual

gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.

Parameters
distanceArraycontains the returned distance data as an array.
amplitudeArraycontains the returned amplitude data as an array.
intensityArraycontains the returned intensity data as an array.
sourceDataArraycontains the complete source data from the camera device.
requiredImageSequencethe required image sequence number
capturedImageSequencethe actually captured image sequence number

Implements mitk::ToFCameraDevice.

Definition at line 218 of file mitkToFCameraMITKPlayerDevice.cpp.

References mitk::ToFCameraDevice::m_BufferSize, mitk::ToFCameraDevice::m_CurrentPos, mitk::ToFCameraDevice::m_ImageMutex, mitk::ToFCameraDevice::m_ImageSequence, mitk::ToFCameraDevice::m_PixelNumber, mitk::ToFCameraDevice::m_RGBPixelNumber, and MITK_INFO.

void mitk::ToFCameraMITKPlayerDevice::GetAmplitudes ( float *  amplitudeArray,
int &  imageSequence 
)
overridevirtual

gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel. Caution! The user is responsible for allocating and deleting the images. These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value

Parameters
imageSequencethe actually captured image sequence number
amplitudeArraycontains the returned amplitude data as an array.

Implements mitk::ToFCameraDevice.

Definition at line 170 of file mitkToFCameraMITKPlayerDevice.cpp.

References mitk::ToFCameraDevice::m_CurrentPos, mitk::ToFCameraDevice::m_ImageMutex, mitk::ToFCameraDevice::m_ImageSequence, and mitk::ToFCameraDevice::m_PixelNumber.

void mitk::ToFCameraMITKPlayerDevice::GetDistances ( float *  distanceArray,
int &  imageSequence 
)
overridevirtual

gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters. Caution! The user is responsible for allocating and deleting the images.

Parameters
distanceArraycontains the returned distances data as an array.
imageSequencethe actually captured image sequence number

Implements mitk::ToFCameraDevice.

Definition at line 194 of file mitkToFCameraMITKPlayerDevice.cpp.

References mitk::ToFCameraDevice::m_CurrentPos, mitk::ToFCameraDevice::m_ImageMutex, mitk::ToFCameraDevice::m_ImageSequence, and mitk::ToFCameraDevice::m_PixelNumber.

void mitk::ToFCameraMITKPlayerDevice::GetIntensities ( float *  intensityArray,
int &  imageSequence 
)
overridevirtual

gets the intensity data from the ToF camera as a greyscale image. Caution! The user is responsible for allocating and deleting the images.

Parameters
intensityArraycontains the returned intensities data as an array.
imageSequencethe actually captured image sequence number

Implements mitk::ToFCameraDevice.

Definition at line 182 of file mitkToFCameraMITKPlayerDevice.cpp.

References mitk::ToFCameraDevice::m_CurrentPos, mitk::ToFCameraDevice::m_ImageMutex, mitk::ToFCameraDevice::m_ImageSequence, and mitk::ToFCameraDevice::m_PixelNumber.

void mitk::ToFCameraMITKPlayerDevice::GetRgb ( unsigned char *  rgbArray,
int &  imageSequence 
)
virtual

gets the rgb data from the ToF camera. Caution! The user is responsible for allocating and deleting the images.

Parameters
rgbArraycontains the returned rgb data as an array.
imageSequencethe actually captured image sequence number

Definition at line 206 of file mitkToFCameraMITKPlayerDevice.cpp.

References mitk::ToFCameraDevice::m_CurrentPos, mitk::ToFCameraDevice::m_ImageMutex, mitk::ToFCameraDevice::m_ImageSequence, and mitk::ToFCameraDevice::m_RGBPixelNumber.

mitk::ToFCameraMITKPlayerDevice::mitkClassMacro ( ToFCameraMITKPlayerDevice  ,
ToFCameraDevice   
)
static Pointer mitk::ToFCameraMITKPlayerDevice::New ( )
static
void mitk::ToFCameraMITKPlayerDevice::SetInputFileName ( std::string  inputFileName)
virtual

Set file name where the data is recorded.

Parameters
inputFileNamename of input file which should be played

Definition at line 261 of file mitkToFCameraMITKPlayerDevice.cpp.

References m_Controller, and m_InputFileName.

void mitk::ToFCameraMITKPlayerDevice::SetProperty ( const char *  propertyKey,
BaseProperty propertyValue 
)
overridevirtual
void mitk::ToFCameraMITKPlayerDevice::StartCamera ( )
overridevirtual
void mitk::ToFCameraMITKPlayerDevice::UpdateCamera ( )
overrideprotectedvirtual

updates the camera for image acquisition

Implements mitk::ToFCameraDevice.

Definition at line 103 of file mitkToFCameraMITKPlayerDevice.cpp.

References m_Controller.

Referenced by Acquire().

Member Data Documentation

ToFCameraMITKPlayerController::Pointer mitk::ToFCameraMITKPlayerDevice::m_Controller
protected

member holding the corresponding controller

Definition at line 128 of file mitkToFCameraMITKPlayerDevice.h.

Referenced by Acquire(), DisconnectCamera(), OnConnectCamera(), SetInputFileName(), SetProperty(), StartCamera(), ToFCameraMITKPlayerDevice(), and UpdateCamera().

std::string mitk::ToFCameraMITKPlayerDevice::m_InputFileName
protected

member holding the file name of the current input file

Definition at line 129 of file mitkToFCameraMITKPlayerDevice.h.

Referenced by SetInputFileName().


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