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

Interface for all representations of PMD ToF devices. ToFCameraPMDDevice internally holds an instance of ToFCameraPMDController and starts a thread that continuously grabs images from the controller. A buffer structure buffers the last acquired images to provide the image data loss-less. More...

#include <mitkToFCameraPMDRawDataDevice.h>

Inheritance diagram for mitk::ToFCameraPMDRawDataDevice:
mitk::ToFCameraDevice mitk::ToFCameraPMDRawDataCamBoardDevice mitk::ToFCameraPMDRawDataCamCubeDevice RawDataDeviceHelperImpl

Public Member Functions

 mitkClassMacro (ToFCameraPMDRawDataDevice, ToFCameraDevice)
 
 itkFactorylessNewMacro (Self)
 
 itkCloneMacro (Self)
 
 itkSetMacro (ChannelSize, int)
 
 itkGetMacro (ChannelSize, int)
 
virtual bool OnConnectCamera ()
 opens a connection to the ToF camera
 
virtual bool DisconnectCamera ()
 closes the connection to the camera
 
virtual void StartCamera ()
 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
 
virtual void StopCamera ()
 stops the continuous updating of the camera
 
virtual void UpdateCamera ()
 updates the camera for image acquisition
 
virtual bool IsCameraActive ()
 returns whether the camera is currently active or not
 
virtual void GetAmplitudes (float *amplitudeArray, int &imageSequence)
 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
 
virtual void GetIntensities (float *intensityArray, int &imageSequence)
 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 GetDistances (float *distanceArray, int &imageSequence)
 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.
 
virtual void GetAllImages (float *distanceArray, float *amplitudeArray, float *intensityArray, char *sourceDataArray, int requiredImageSequence, int &capturedImageSequence, unsigned char *rgbDataArray=nullptr)
 gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
 
ToFCameraPMDController::Pointer GetController ()
 returns the corresponding camera controller
 
virtual void GetChannelSourceData (short *, vtkShortArray *)
 
virtual void SetProperty (const char *propertyKey, BaseProperty *propertyValue)
 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 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

 ToFCameraPMDRawDataDevice ()
 
 ~ToFCameraPMDRawDataDevice ()
 
virtual void AllocateSourceData ()
 method for allocating m_SourceDataArray and m_SourceDataBuffer
 
virtual void CleanUpSourceData ()
 method for cleaning up memory allocated for m_SourceDataArray and m_SourceDataBuffer
 
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
 
void GetNextPos ()
 moves the position pointer m_CurrentPos to the next position in the buffer if that's not the next free position to prevent reading from an empty buffer
 
void XYAxisFlipImage (float *imageData, float *&flippedData, int xAxis, int yAxis, int dimension=1)
 gets the image data and flips it according to user needs Caution! The user is responsible for allocating and deleting the data.
 
- Protected Member Functions inherited from mitk::ToFCameraDevice
 ToFCameraDevice ()
 
 ~ToFCameraDevice () override
 

Static Protected Member Functions

static ITK_THREAD_RETURN_TYPE Acquire (void *pInfoStruct)
 Thread method continuously acquiring images from the ToF hardware.
 

Protected Attributes

ToFCameraPMDController::Pointer m_Controller
 corresponding CameraController
 
ThreadedToFRawDataReconstruction::Pointer m_RawDataSource
 
char ** m_SourceDataBuffer
 buffer holding the last acquired images
 
char * m_SourceDataArray
 array holding the current PMD source data
 
short * m_ShortSourceData
 array holding the current PMD raw data
 
unsigned int m_OriginControllerWidth
 holds the original controller width
 
unsigned int m_OriginControllerHeight
 holds the original controller height
 
- 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

Interface for all representations of PMD ToF devices. ToFCameraPMDDevice internally holds an instance of ToFCameraPMDController and starts a thread that continuously grabs images from the controller. A buffer structure buffers the last acquired images to provide the image data loss-less.

Definition at line 30 of file mitkToFCameraPMDRawDataDevice.h.

Constructor & Destructor Documentation

◆ ToFCameraPMDRawDataDevice()

mitk::ToFCameraPMDRawDataDevice::ToFCameraPMDRawDataDevice ( )
protected

Definition at line 32 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ ~ToFCameraPMDRawDataDevice()

mitk::ToFCameraPMDRawDataDevice::~ToFCameraPMDRawDataDevice ( )
protected

Definition at line 39 of file mitkToFCameraPMDRawDataDevice.cpp.

Member Function Documentation

◆ Acquire()

ITK_THREAD_RETURN_TYPE mitk::ToFCameraPMDRawDataDevice::Acquire ( void * pInfoStruct)
staticprotected

Thread method continuously acquiring images from the ToF hardware.

Definition at line 142 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ AllocatePixelArrays()

void mitk::ToFCameraPMDRawDataDevice::AllocatePixelArrays ( )
protectedvirtual

method for allocating memory for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray

Reimplemented from mitk::ToFCameraDevice.

Definition at line 412 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ AllocateSourceData()

void mitk::ToFCameraPMDRawDataDevice::AllocateSourceData ( )
protectedvirtual

method for allocating m_SourceDataArray and m_SourceDataBuffer

Definition at line 428 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ CleanupPixelArrays()

void mitk::ToFCameraPMDRawDataDevice::CleanupPixelArrays ( )
protectedvirtual

method for cleanup memory allocated for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray

Reimplemented from mitk::ToFCameraDevice.

Definition at line 392 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ CleanUpSourceData()

void mitk::ToFCameraPMDRawDataDevice::CleanUpSourceData ( )
protectedvirtual

method for cleaning up memory allocated for m_SourceDataArray and m_SourceDataBuffer

Definition at line 443 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ DisconnectCamera()

bool mitk::ToFCameraPMDRawDataDevice::DisconnectCamera ( )
virtual

closes the connection to the camera

Implements mitk::ToFCameraDevice.

Definition at line 69 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ GetAllImages()

void mitk::ToFCameraPMDRawDataDevice::GetAllImages ( float * distanceArray,
float * amplitudeArray,
float * intensityArray,
char * sourceDataArray,
int requiredImageSequence,
int & capturedImageSequence,
unsigned char * rgbDataArray = nullptr )
virtual

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.

Reimplemented in mitk::ToFCameraPMDRawDataCamBoardDevice.

Definition at line 264 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ GetAmplitudes()

void mitk::ToFCameraPMDRawDataDevice::GetAmplitudes ( float * amplitudeArray,
int & imageSequence )
virtual

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.

Reimplemented in mitk::ToFCameraPMDRawDataCamBoardDevice.

Definition at line 225 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ GetChannelSourceData()

virtual void mitk::ToFCameraPMDRawDataDevice::GetChannelSourceData ( short * ,
vtkShortArray *  )
inlinevirtual

◆ GetController()

ToFCameraPMDController::Pointer mitk::ToFCameraPMDRawDataDevice::GetController ( )

returns the corresponding camera controller

Definition at line 369 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ GetDistances()

void mitk::ToFCameraPMDRawDataDevice::GetDistances ( float * distanceArray,
int & imageSequence )
virtual

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.

Reimplemented in mitk::ToFCameraPMDRawDataCamBoardDevice.

Definition at line 251 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ GetIntensities()

void mitk::ToFCameraPMDRawDataDevice::GetIntensities ( float * intensityArray,
int & imageSequence )
virtual

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.

Reimplemented in mitk::ToFCameraPMDRawDataCamBoardDevice.

Definition at line 238 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ GetNextPos()

void mitk::ToFCameraPMDRawDataDevice::GetNextPos ( )
protected

moves the position pointer m_CurrentPos to the next position in the buffer if that's not the next free position to prevent reading from an empty buffer

◆ IsCameraActive()

bool mitk::ToFCameraPMDRawDataDevice::IsCameraActive ( )
virtual

returns whether the camera is currently active or not

Reimplemented from mitk::ToFCameraDevice.

Definition at line 126 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ itkCloneMacro()

mitk::ToFCameraPMDRawDataDevice::itkCloneMacro ( Self )

◆ itkFactorylessNewMacro()

mitk::ToFCameraPMDRawDataDevice::itkFactorylessNewMacro ( Self )

◆ itkGetMacro()

mitk::ToFCameraPMDRawDataDevice::itkGetMacro ( ChannelSize ,
int  )

◆ itkSetMacro()

mitk::ToFCameraPMDRawDataDevice::itkSetMacro ( ChannelSize ,
int  )

◆ mitkClassMacro()

mitk::ToFCameraPMDRawDataDevice::mitkClassMacro ( ToFCameraPMDRawDataDevice ,
ToFCameraDevice  )

◆ OnConnectCamera()

bool mitk::ToFCameraPMDRawDataDevice::OnConnectCamera ( )
virtual

opens a connection to the ToF camera

Implements mitk::ToFCameraDevice.

Definition at line 44 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ SetProperty()

void mitk::ToFCameraPMDRawDataDevice::SetProperty ( const char * propertyKey,
BaseProperty * propertyValue )
virtual

set a BaseProperty

Reimplemented from mitk::ToFCameraDevice.

Reimplemented in mitk::ToFCameraPMDRawDataCamCubeDevice.

Definition at line 374 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ StartCamera()

void mitk::ToFCameraPMDRawDataDevice::StartCamera ( )
virtual

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 83 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ StopCamera()

void mitk::ToFCameraPMDRawDataDevice::StopCamera ( )
virtual

stops the continuous updating of the camera

Reimplemented from mitk::ToFCameraDevice.

Definition at line 111 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ UpdateCamera()

void mitk::ToFCameraPMDRawDataDevice::UpdateCamera ( )
virtual

updates the camera for image acquisition

Implements mitk::ToFCameraDevice.

Definition at line 134 of file mitkToFCameraPMDRawDataDevice.cpp.

◆ XYAxisFlipImage()

void mitk::ToFCameraPMDRawDataDevice::XYAxisFlipImage ( float * imageData,
float *& flippedData,
int xAxis,
int yAxis,
int dimension = 1 )
protected

gets the image data and flips it according to user needs Caution! The user is responsible for allocating and deleting the data.

Parameters
imageDatacontains array to the input data.
flippedDatacontains flipped output array - Caution! The user is responsible for allocating and deleting the data. Size should be equal to imageData!
xAxisflag is set to flip around x axis (1 - set, 0 - not set).
yAxisflag is set to flip around y axis (1 - set, 0 - not set).
dimensioncontains the extend of the z dimension (preset is 1)

Definition at line 310 of file mitkToFCameraPMDRawDataDevice.cpp.

Member Data Documentation

◆ m_Controller

ToFCameraPMDController::Pointer mitk::ToFCameraPMDRawDataDevice::m_Controller
protected

corresponding CameraController

Definition at line 155 of file mitkToFCameraPMDRawDataDevice.h.

◆ m_OriginControllerHeight

unsigned int mitk::ToFCameraPMDRawDataDevice::m_OriginControllerHeight
protected

holds the original controller height

Definition at line 161 of file mitkToFCameraPMDRawDataDevice.h.

◆ m_OriginControllerWidth

unsigned int mitk::ToFCameraPMDRawDataDevice::m_OriginControllerWidth
protected

holds the original controller width

Definition at line 160 of file mitkToFCameraPMDRawDataDevice.h.

◆ m_RawDataSource

ThreadedToFRawDataReconstruction::Pointer mitk::ToFCameraPMDRawDataDevice::m_RawDataSource
protected

Definition at line 156 of file mitkToFCameraPMDRawDataDevice.h.

◆ m_ShortSourceData

short* mitk::ToFCameraPMDRawDataDevice::m_ShortSourceData
protected

array holding the current PMD raw data

Definition at line 159 of file mitkToFCameraPMDRawDataDevice.h.

◆ m_SourceDataArray

char* mitk::ToFCameraPMDRawDataDevice::m_SourceDataArray
protected

array holding the current PMD source data

Definition at line 158 of file mitkToFCameraPMDRawDataDevice.h.

◆ m_SourceDataBuffer

char** mitk::ToFCameraPMDRawDataDevice::m_SourceDataBuffer
protected

buffer holding the last acquired images

Definition at line 157 of file mitkToFCameraPMDRawDataDevice.h.


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