16#include "vtkSmartPointer.h"
31 bool ok = Superclass::ConnectCamera();
48 this->SetChannelSize(channelSize);
49 signed short* channel1;
50 signed short* channel2;
51 signed short* channel3;
52 signed short* channel4;
55 cvtkChannelArray->SetNumberOfComponents(channelSize);
56 cvtkChannelArray->SetNumberOfTuples(4);
57 cvtkChannelArray->Allocate(1);
59 channel1 = sourceData;
60 cvtkChannelArray->InsertTupleValue(0,channel1);
61 sourceData += channelSize;
62 channel2 = sourceData;
63 cvtkChannelArray->InsertTupleValue(1,channel2);
64 sourceData += channelSize;
65 channel3 = sourceData;
66 cvtkChannelArray->InsertTupleValue(2,channel3);
67 sourceData += channelSize;
68 channel4 = sourceData;
69 cvtkChannelArray->InsertTupleValue(3,channel4);
70 vtkChannelArray->DeepCopy(cvtkChannelArray);
88 MITK_WARN(
"ToF") <<
"Warning: Data can only be acquired if camera is active.";
101 MITK_WARN(
"ToF") <<
"Warning: Data can only be acquired if camera is active.";
114 MITK_WARN(
"ToF") <<
"Warning: Data can only be acquired if camera is active.";
119 int requiredImageSequence,
int& capturedImageSequence,
unsigned char* rgbDataArray)
127 MITK_INFO <<
"Buffer empty!! ";
134 if ((requiredImageSequence < 0) || (requiredImageSequence > this->
m_ImageSequence))
149 capturedImageSequence = requiredImageSequence;
160 MITK_WARN(
"ToF") <<
"Warning: Data can only be acquired if camera is active.";
164 void ToFCameraPMDRawDataCamBoardDevice::ResizeOutputImage(
float* in,
float* out)
171 outMat = temp.transpose();
173 outMat.copy_out(out);
int m_ImageSequence
counter for acquired images
PropertyList::Pointer m_PropertyList
a list of the corresponding properties
virtual void SetProperty(const char *propertyKey, BaseProperty *propertyValue)
set a BaseProperty property in the property list
int m_CaptureWidth
width of the range image (x dimension)
int m_CurrentPos
current position in the buffer which will be retrieved by the Get methods
int m_PixelNumber
number of pixels in the range image (m_CaptureWidth*m_CaptureHeight)
int m_CaptureHeight
height of the range image (y dimension)
bool m_CameraActive
flag indicating if the camera is currently active or not. Caution: thread safe access only!
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
float * m_IntensityArray
float array holding the intensity image
int m_SourceDataSize
size of the PMD source data
float * m_DistanceArray
float array holding the distance image
Interface to the Time-of-Flight (ToF) camera PMD CamBoard.
void GetIntensities(float *intensityArray, int &imageSequence)
Returns intensity data.
ToFCameraPMDRawDataCamBoardDevice()
virtual void GetChannelSourceData(short *sourceData, vtkShortArray *vtkChannelArray)
Transforms the sourceData into an array with four tuples holding the channels for raw data reconstruc...
~ToFCameraPMDRawDataCamBoardDevice()
void GetAmplitudes(float *amplitudeArray, int &imageSequence)
Returns amplitude data.
void GetDistances(float *distanceArray, int &imageSequence)
Returns distance data.
void GetAllImages(float *distanceArray, float *amplitudeArray, float *intensityArray, char *sourceDataArray, int requiredImageSequence, int &capturedImageSequence, unsigned char *rgbDataArray=nullptr)
Returns all image data at once.
BaseProperty * propertyValue
bool ConnectCamera()
Establishes camera connection and sets the class variables.
ToFCameraPMDController::Pointer m_Controller
corresponding CameraController
virtual void AllocatePixelArrays()
method for allocating memory for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray
unsigned int m_OriginControllerWidth
holds the original controller width
char ** m_SourceDataBuffer
buffer holding the last acquired images
virtual void AllocateSourceData()
method for allocating m_SourceDataArray and m_SourceDataBuffer
virtual void SetProperty(const char *propertyKey, BaseProperty *propertyValue)
set a BaseProperty
unsigned int m_OriginControllerHeight
holds the original controller height