Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
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>
Public Member Functions | |
mitkClassMacro (ToFCameraPMDRawDataDevice, ToFCameraDevice) | |
Pointer | Clone () const |
virtual void | SetChannelSize (int _arg) |
virtual int | GetChannelSize () |
virtual bool | OnConnectCamera () |
opens a connection to the ToF camera More... | |
virtual bool | DisconnectCamera () |
closes the connection to the camera More... | |
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 More... | |
virtual void | StopCamera () |
stops the continuous updating of the camera More... | |
virtual void | UpdateCamera () |
updates the camera for image acquisition More... | |
virtual bool | IsCameraActive () |
returns whether the camera is currently active or not More... | |
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 More... | |
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. More... | |
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. More... | |
virtual void | GetAllImages (float *distanceArray, float *amplitudeArray, float *intensityArray, char *sourceDataArray, int requiredImageSequence, int &capturedImageSequence, unsigned char *rgbDataArray=NULL) |
gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images. More... | |
ToFCameraPMDController::Pointer | GetController () |
returns the corresponding camera controller More... | |
virtual void | GetChannelSourceData (short *, vtkShortArray *) |
virtual void | SetProperty (const char *propertyKey, BaseProperty *propertyValue) |
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 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 BaseProperty * | GetProperty (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 | |
ToFCameraPMDRawDataDevice () | |
~ToFCameraPMDRawDataDevice () | |
virtual void | AllocateSourceData () |
method for allocating m_SourceDataArray and m_SourceDataBuffer More... | |
virtual void | CleanUpSourceData () |
method for cleaning up memory allocated for m_SourceDataArray and m_SourceDataBuffer More... | |
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... | |
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 More... | |
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. More... | |
Protected Member Functions inherited from mitk::ToFCameraDevice | |
ToFCameraDevice () | |
~ToFCameraDevice () | |
Static Protected Member Functions | |
static ITK_THREAD_RETURN_TYPE | Acquire (void *pInfoStruct) |
Thread method continuously acquiring images from the ToF hardware. More... | |
Protected Attributes | |
ToFCameraPMDController::Pointer | m_Controller |
corresponding CameraController More... | |
ThreadedToFRawDataReconstruction::Pointer | m_RawDataSource |
char ** | m_SourceDataBuffer |
buffer holding the last acquired images More... | |
char * | m_SourceDataArray |
array holding the current PMD source data More... | |
short * | m_ShortSourceData |
array holding the current PMD raw data More... | |
unsigned int | m_OriginControllerWidth |
holds the original controller width More... | |
unsigned int | m_OriginControllerHeight |
holds the original controller height 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... | |
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 34 of file mitkToFCameraPMDRawDataDevice.h.
|
protected |
Definition at line 36 of file mitkToFCameraPMDRawDataDevice.cpp.
References m_RawDataSource, and mitk::ThreadedToFRawDataReconstruction::New().
|
protected |
Definition at line 43 of file mitkToFCameraPMDRawDataDevice.cpp.
References CleanUpSourceData().
|
staticprotected |
Thread method continuously acquiring images from the ToF hardware.
Definition at line 146 of file mitkToFCameraPMDRawDataDevice.cpp.
References GetChannelSize(), GetChannelSourceData(), IsCameraActive(), mitk::ToFCameraDevice::m_AmplitudeArray, mitk::ToFCameraDevice::m_BufferSize, m_Controller, mitk::ToFCameraDevice::m_CurrentPos, mitk::ToFCameraDevice::m_DistanceArray, mitk::ToFCameraDevice::m_FreePos, mitk::ToFCameraDevice::m_ImageMutex, mitk::ToFCameraDevice::m_ImageSequence, mitk::ToFCameraDevice::m_IntensityArray, m_OriginControllerHeight, m_OriginControllerWidth, m_RawDataSource, m_ShortSourceData, m_SourceDataArray, MITK_INFO, mitk::New(), mitk::RealTimeClock::New(), and UpdateCamera().
Referenced by StartCamera().
|
protectedvirtual |
method for allocating memory for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray
Reimplemented from mitk::ToFCameraDevice.
Definition at line 416 of file mitkToFCameraPMDRawDataDevice.cpp.
References CleanupPixelArrays(), mitk::ToFCameraDevice::m_AmplitudeArray, mitk::ToFCameraDevice::m_DistanceArray, mitk::ToFCameraDevice::m_IntensityArray, mitk::ToFCameraDevice::m_PixelNumber, m_ShortSourceData, and mitk::ToFCameraDevice::m_SourceDataSize.
Referenced by mitk::ToFCameraPMDRawDataCamBoardDevice::ConnectCamera(), and OnConnectCamera().
|
protectedvirtual |
method for allocating m_SourceDataArray and m_SourceDataBuffer
Definition at line 432 of file mitkToFCameraPMDRawDataDevice.cpp.
References CleanUpSourceData(), mitk::ToFCameraDevice::m_MaxBufferSize, m_SourceDataArray, m_SourceDataBuffer, and mitk::ToFCameraDevice::m_SourceDataSize.
Referenced by mitk::ToFCameraPMDRawDataCamBoardDevice::ConnectCamera(), and OnConnectCamera().
|
protectedvirtual |
method for cleanup memory allocated for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray
Reimplemented from mitk::ToFCameraDevice.
Definition at line 396 of file mitkToFCameraPMDRawDataDevice.cpp.
References mitk::ToFCameraDevice::m_AmplitudeArray, mitk::ToFCameraDevice::m_DistanceArray, mitk::ToFCameraDevice::m_IntensityArray, and m_ShortSourceData.
Referenced by AllocatePixelArrays().
|
protectedvirtual |
method for cleaning up memory allocated for m_SourceDataArray and m_SourceDataBuffer
Definition at line 447 of file mitkToFCameraPMDRawDataDevice.cpp.
References mitk::ToFCameraDevice::m_MaxBufferSize, m_SourceDataArray, and m_SourceDataBuffer.
Referenced by AllocateSourceData(), and ~ToFCameraPMDRawDataDevice().
Pointer mitk::ToFCameraPMDRawDataDevice::Clone | ( | ) | const |
|
virtual |
closes the connection to the camera
Implements mitk::ToFCameraDevice.
Definition at line 73 of file mitkToFCameraPMDRawDataDevice.cpp.
References mitk::ToFCameraDevice::m_CameraConnected, and m_Controller.
|
virtual |
gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
distanceArray | contains the returned distance data as an array. |
amplitudeArray | contains the returned amplitude data as an array. |
intensityArray | contains the returned intensity data as an array. |
sourceDataArray | contains the complete source data from the camera device. |
requiredImageSequence | the required image sequence number |
capturedImageSequence | the actually captured image sequence number |
Implements mitk::ToFCameraDevice.
Reimplemented in mitk::ToFCameraPMDRawDataCamBoardDevice.
Definition at line 268 of file mitkToFCameraPMDRawDataDevice.cpp.
References mitk::ToFCameraDevice::m_AmplitudeArray, mitk::ToFCameraDevice::m_BufferSize, mitk::ToFCameraDevice::m_CameraActive, mitk::ToFCameraDevice::m_CurrentPos, mitk::ToFCameraDevice::m_DistanceArray, mitk::ToFCameraDevice::m_ImageSequence, mitk::ToFCameraDevice::m_IntensityArray, mitk::ToFCameraDevice::m_PixelNumber, m_SourceDataBuffer, mitk::ToFCameraDevice::m_SourceDataSize, MITK_INFO, and MITK_WARN.
|
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
imageSequence | the actually captured image sequence number |
amplitudeArray | contains the returned amplitude data as an array. |
Implements mitk::ToFCameraDevice.
Reimplemented in mitk::ToFCameraPMDRawDataCamBoardDevice.
Definition at line 229 of file mitkToFCameraPMDRawDataDevice.cpp.
References mitk::ToFCameraDevice::m_AmplitudeArray, mitk::ToFCameraDevice::m_CameraActive, mitk::ToFCameraDevice::m_ImageSequence, mitk::ToFCameraDevice::m_PixelNumber, and MITK_WARN.
|
virtual |
Referenced by Acquire().
|
inlinevirtual |
Reimplemented in mitk::ToFCameraPMDRawDataCamBoardDevice, and mitk::ToFCameraPMDRawDataCamCubeDevice.
Definition at line 105 of file mitkToFCameraPMDRawDataDevice.h.
Referenced by Acquire().
ToFCameraPMDController::Pointer mitk::ToFCameraPMDRawDataDevice::GetController | ( | ) |
returns the corresponding camera controller
Definition at line 373 of file mitkToFCameraPMDRawDataDevice.cpp.
References m_Controller.
|
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.
distanceArray | contains the returned distances data as an array. |
imageSequence | the actually captured image sequence number |
Implements mitk::ToFCameraDevice.
Reimplemented in mitk::ToFCameraPMDRawDataCamBoardDevice.
Definition at line 255 of file mitkToFCameraPMDRawDataDevice.cpp.
References mitk::ToFCameraDevice::m_CameraActive, mitk::ToFCameraDevice::m_DistanceArray, mitk::ToFCameraDevice::m_ImageSequence, mitk::ToFCameraDevice::m_PixelNumber, and MITK_WARN.
|
virtual |
gets the intensity data from the ToF camera as a greyscale image. Caution! The user is responsible for allocating and deleting the images.
intensityArray | contains the returned intensities data as an array. |
imageSequence | the actually captured image sequence number |
Implements mitk::ToFCameraDevice.
Reimplemented in mitk::ToFCameraPMDRawDataCamBoardDevice.
Definition at line 242 of file mitkToFCameraPMDRawDataDevice.cpp.
References mitk::ToFCameraDevice::m_CameraActive, mitk::ToFCameraDevice::m_ImageSequence, mitk::ToFCameraDevice::m_IntensityArray, mitk::ToFCameraDevice::m_PixelNumber, and MITK_WARN.
|
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
|
virtual |
returns whether the camera is currently active or not
Reimplemented from mitk::ToFCameraDevice.
Definition at line 130 of file mitkToFCameraPMDRawDataDevice.cpp.
References mitk::ToFCameraDevice::m_CameraActive, and mitk::ToFCameraDevice::m_CameraActiveMutex.
Referenced by Acquire().
mitk::ToFCameraPMDRawDataDevice::mitkClassMacro | ( | ToFCameraPMDRawDataDevice | , |
ToFCameraDevice | |||
) |
|
static |
|
virtual |
opens a connection to the ToF camera
Implements mitk::ToFCameraDevice.
Definition at line 48 of file mitkToFCameraPMDRawDataDevice.cpp.
References AllocatePixelArrays(), AllocateSourceData(), mitk::ToFCameraDevice::m_CameraConnected, mitk::ToFCameraDevice::m_CaptureHeight, mitk::ToFCameraDevice::m_CaptureWidth, m_Controller, m_OriginControllerHeight, m_OriginControllerWidth, mitk::ToFCameraDevice::m_PixelNumber, and mitk::ToFCameraDevice::m_SourceDataSize.
|
virtual |
|
virtual |
set a BaseProperty
Reimplemented from mitk::ToFCameraDevice.
Reimplemented in mitk::ToFCameraPMDRawDataCamBoardDevice, and mitk::ToFCameraPMDRawDataCamCubeDevice.
Definition at line 378 of file mitkToFCameraPMDRawDataDevice.cpp.
References mitk::ToFCameraDevice::GetIntProperty(), m_Controller, mitk::ToFCameraDevice::m_PropertyList, and mitk::ToFCameraDevice::SetProperty().
Referenced by mitk::ToFCameraPMDRawDataCamCubeDevice::SetProperty(), and mitk::ToFCameraPMDRawDataCamBoardDevice::SetProperty().
|
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 87 of file mitkToFCameraPMDRawDataDevice.cpp.
References Acquire(), mitk::ToFCameraDevice::m_BufferSize, mitk::ToFCameraDevice::m_CameraActive, mitk::ToFCameraDevice::m_CameraActiveMutex, mitk::ToFCameraDevice::m_CameraConnected, m_Controller, mitk::ToFCameraDevice::m_CurrentPos, mitk::ToFCameraDevice::m_FreePos, mitk::ToFCameraDevice::m_ImageMutex, mitk::ToFCameraDevice::m_ImageSequence, mitk::ToFCameraDevice::m_MultiThreader, m_SourceDataBuffer, mitk::ToFCameraDevice::m_ThreadID, and MITK_INFO.
|
virtual |
stops the continuous updating of the camera
Reimplemented from mitk::ToFCameraDevice.
Definition at line 115 of file mitkToFCameraPMDRawDataDevice.cpp.
References mitk::ToFCameraDevice::m_CameraActive, mitk::ToFCameraDevice::m_CameraActiveMutex, mitk::ToFCameraDevice::m_MultiThreader, and mitk::ToFCameraDevice::m_ThreadID.
|
virtual |
updates the camera for image acquisition
Implements mitk::ToFCameraDevice.
Definition at line 138 of file mitkToFCameraPMDRawDataDevice.cpp.
References m_Controller.
Referenced by Acquire().
|
protected |
gets the image data and flips it according to user needs Caution! The user is responsible for allocating and deleting the data.
imageData | contains array to the input data. |
flippedData | contains flipped output array - Caution! The user is responsible for allocating and deleting the data. Size should be equal to imageData! |
xAxis | flag is set to flip around x axis (1 - set, 0 - not set). |
yAxis | flag is set to flip around y axis (1 - set, 0 - not set). |
dimension | contains the extend of the z dimension (preset is 1) |
Definition at line 314 of file mitkToFCameraPMDRawDataDevice.cpp.
References mitk::ToFCameraDevice::GetCaptureHeight(), and mitk::ToFCameraDevice::GetCaptureWidth().
|
protected |
corresponding CameraController
Definition at line 157 of file mitkToFCameraPMDRawDataDevice.h.
Referenced by Acquire(), mitk::ToFCameraPMDRawDataCamBoardDevice::ConnectCamera(), DisconnectCamera(), GetController(), OnConnectCamera(), mitk::ToFCameraPMDRawDataCamCubeDevice::SetProperty(), SetProperty(), StartCamera(), mitk::ToFCameraPMDRawDataCamBoardDevice::ToFCameraPMDRawDataCamBoardDevice(), mitk::ToFCameraPMDRawDataCamCubeDevice::ToFCameraPMDRawDataCamCubeDevice(), and UpdateCamera().
|
protected |
holds the original controller height
Definition at line 163 of file mitkToFCameraPMDRawDataDevice.h.
Referenced by Acquire(), mitk::ToFCameraPMDRawDataCamBoardDevice::ConnectCamera(), mitk::ToFCameraPMDRawDataCamBoardDevice::GetChannelSourceData(), and OnConnectCamera().
|
protected |
holds the original controller width
Definition at line 162 of file mitkToFCameraPMDRawDataDevice.h.
Referenced by Acquire(), mitk::ToFCameraPMDRawDataCamBoardDevice::ConnectCamera(), mitk::ToFCameraPMDRawDataCamBoardDevice::GetChannelSourceData(), and OnConnectCamera().
|
protected |
Definition at line 158 of file mitkToFCameraPMDRawDataDevice.h.
Referenced by Acquire(), and ToFCameraPMDRawDataDevice().
|
protected |
array holding the current PMD raw data
Definition at line 161 of file mitkToFCameraPMDRawDataDevice.h.
Referenced by Acquire(), AllocatePixelArrays(), and CleanupPixelArrays().
|
protected |
array holding the current PMD source data
Definition at line 160 of file mitkToFCameraPMDRawDataDevice.h.
Referenced by Acquire(), AllocateSourceData(), and CleanUpSourceData().
|
protected |
buffer holding the last acquired images
Definition at line 159 of file mitkToFCameraPMDRawDataDevice.h.
Referenced by AllocateSourceData(), CleanUpSourceData(), mitk::ToFCameraPMDRawDataCamBoardDevice::GetAllImages(), GetAllImages(), and StartCamera().