MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitk::ToFCameraMITKPlayerDevice Class Reference

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

#include <mitkToFCameraMITKPlayerDevice.h>

Inheritance diagram for mitk::ToFCameraMITKPlayerDevice:
mitk::ToFCameraDevice mitk::ToFCameraMITKPlayerDeviceImpl

Public Member Functions

 mitkClassMacro (ToFCameraMITKPlayerDevice, ToFCameraDevice)
 
 itkFactorylessNewMacro (Self)
 
 itkCloneMacro (Self)
 
bool OnConnectCamera () override
 opens a connection to the ToF camera
 
bool DisconnectCamera () override
 closes the connection to the camera
 
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
 
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
 
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.
 
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.
 
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.
 
void GetAllImages (float *distanceArray, float *amplitudeArray, float *intensityArray, char *sourceDataArray, int requiredImageSequence, int &capturedImageSequence, unsigned char *rgbDataArray=nullptr) override
 gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
 
virtual void SetInputFileName (std::string inputFileName)
 Set file name where the data is recorded.
 
void SetProperty (const char *propertyKey, BaseProperty *propertyValue) override
 set a BaseProperty
 
- Public Member Functions inherited from mitk::ToFCameraDevice
 mitkClassMacroItkParent (ToFCameraDevice, itk::Object)
 
virtual bool ConnectCamera ()
 ConnectCamera Internally calls OnConnectCamera() of the respective device implementation.
 
virtual void StopCamera ()
 stops the continuous updating of the camera
 
virtual bool IsCameraActive ()
 returns true if the camera is connected and started
 
virtual bool IsCameraConnected ()
 returns true if the camera is connected
 
 itkGetMacro (CaptureWidth, int)
 get the currently set capture width
 
 itkGetMacro (CaptureHeight, int)
 get the currently set capture height
 
 itkGetMacro (SourceDataSize, int)
 get the currently set source data size
 
 itkGetMacro (BufferSize, int)
 get the currently set buffer size
 
 itkGetMacro (MaxBufferSize, int)
 get the currently set max buffer size
 
void SetBoolProperty (const char *propertyKey, bool boolValue)
 set a bool property in the property list
 
void SetIntProperty (const char *propertyKey, int intValue)
 set an int property in the property list
 
void SetFloatProperty (const char *propertyKey, float floatValue)
 set a float property in the property list
 
void SetStringProperty (const char *propertyKey, const char *stringValue)
 set a string property in the property list
 
virtual BaseProperty * GetProperty (const char *propertyKey)
 get a BaseProperty from the property list
 
bool GetBoolProperty (const char *propertyKey, bool &boolValue)
 get a bool from the property list
 
bool GetStringProperty (const char *propertyKey, std::string &string)
 get a string from the property list
 
bool GetIntProperty (const char *propertyKey, int &integer)
 get an int from the property list
 
virtual int GetRGBCaptureWidth ()
 
virtual int GetRGBCaptureHeight ()
 

Protected Member Functions

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

Protected Attributes

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

Detailed Description

Device class representing a player for MITK-ToF images.

Definition at line 31 of file mitkToFCameraMITKPlayerDevice.h.

Constructor & Destructor Documentation

◆ ToFCameraMITKPlayerDevice()

mitk::ToFCameraMITKPlayerDevice::ToFCameraMITKPlayerDevice ( )
protected

Definition at line 22 of file mitkToFCameraMITKPlayerDevice.cpp.

◆ ~ToFCameraMITKPlayerDevice()

mitk::ToFCameraMITKPlayerDevice::~ToFCameraMITKPlayerDevice ( )
overrideprotected

Definition at line 28 of file mitkToFCameraMITKPlayerDevice.cpp.

Member Function Documentation

◆ Acquire()

void mitk::ToFCameraMITKPlayerDevice::Acquire ( )
protected

Thread method continuously acquiring images from the specified input file.

Definition at line 103 of file mitkToFCameraMITKPlayerDevice.cpp.

◆ AllocateDataBuffers()

void mitk::ToFCameraMITKPlayerDevice::AllocateDataBuffers ( )
protected

Allocate pixel buffers.

Definition at line 336 of file mitkToFCameraMITKPlayerDevice.cpp.

◆ CleanUpDataBuffers()

void mitk::ToFCameraMITKPlayerDevice::CleanUpDataBuffers ( )
protected

Clean up memory (pixel buffers)

Definition at line 300 of file mitkToFCameraMITKPlayerDevice.cpp.

◆ DisconnectCamera()

bool mitk::ToFCameraMITKPlayerDevice::DisconnectCamera ( )
overridevirtual

closes the connection to the camera

Implements mitk::ToFCameraDevice.

Definition at line 58 of file mitkToFCameraMITKPlayerDevice.cpp.

◆ GetAllImages()

void mitk::ToFCameraMITKPlayerDevice::GetAllImages ( float * distanceArray,
float * amplitudeArray,
float * intensityArray,
char * sourceDataArray,
int requiredImageSequence,
int & capturedImageSequence,
unsigned char * rgbDataArray = nullptr )
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
rgbDataArray

Implements mitk::ToFCameraDevice.

Definition at line 198 of file mitkToFCameraMITKPlayerDevice.cpp.

◆ GetAmplitudes()

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 150 of file mitkToFCameraMITKPlayerDevice.cpp.

◆ GetDistances()

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 174 of file mitkToFCameraMITKPlayerDevice.cpp.

◆ GetIntensities()

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 162 of file mitkToFCameraMITKPlayerDevice.cpp.

◆ GetRgb()

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 186 of file mitkToFCameraMITKPlayerDevice.cpp.

◆ itkCloneMacro()

mitk::ToFCameraMITKPlayerDevice::itkCloneMacro ( Self )

◆ itkFactorylessNewMacro()

mitk::ToFCameraMITKPlayerDevice::itkFactorylessNewMacro ( Self )

◆ mitkClassMacro()

mitk::ToFCameraMITKPlayerDevice::mitkClassMacro ( ToFCameraMITKPlayerDevice ,
ToFCameraDevice  )

◆ OnConnectCamera()

bool mitk::ToFCameraMITKPlayerDevice::OnConnectCamera ( )
overridevirtual

opens a connection to the ToF camera

Implements mitk::ToFCameraDevice.

Definition at line 34 of file mitkToFCameraMITKPlayerDevice.cpp.

◆ SetInputFileName()

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 241 of file mitkToFCameraMITKPlayerDevice.cpp.

◆ SetProperty()

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

set a BaseProperty

Reimplemented from mitk::ToFCameraDevice.

Definition at line 247 of file mitkToFCameraMITKPlayerDevice.cpp.

◆ StartCamera()

void mitk::ToFCameraMITKPlayerDevice::StartCamera ( )
overridevirtual

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

Implements mitk::ToFCameraDevice.

Definition at line 69 of file mitkToFCameraMITKPlayerDevice.cpp.

◆ UpdateCamera()

void mitk::ToFCameraMITKPlayerDevice::UpdateCamera ( )
overrideprotectedvirtual

updates the camera for image acquisition

Implements mitk::ToFCameraDevice.

Definition at line 98 of file mitkToFCameraMITKPlayerDevice.cpp.

Member Data Documentation

◆ m_Controller

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

member holding the corresponding controller

Definition at line 124 of file mitkToFCameraMITKPlayerDevice.h.

◆ m_InputFileName

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

member holding the file name of the current input file

Definition at line 125 of file mitkToFCameraMITKPlayerDevice.h.


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