16 #include "vtkSmartPointer.h" 31 bool ok = Superclass::ConnectCamera();
49 signed short* channel1;
50 signed short* channel2;
51 signed short* channel3;
52 signed short* channel4;
54 vtkSmartPointer<vtkShortArray> cvtkChannelArray = vtkSmartPointer<vtkShortArray>::New();
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)
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);
void GetDistances(float *distanceArray, int &imageSequence)
Returns distance data.
virtual void GetChannelSourceData(short *sourceData, vtkShortArray *vtkChannelArray)
Transforms the sourceData into an array with four tuples holding the channels for raw data reconstruc...
virtual void SetProperty(const char *propertyKey, BaseProperty *propertyValue)
set a BaseProperty
virtual int GetCaptureHeight()
get the currently set capture height
char ** m_SourceDataBuffer
buffer holding the last acquired images
~ToFCameraPMDRawDataCamBoardDevice()
int m_SourceDataSize
size of the PMD source data
float * m_IntensityArray
float array holding the intensity image
unsigned int m_OriginControllerHeight
holds the original controller height
int m_PixelNumber
number of pixels in the range image (m_CaptureWidth*m_CaptureHeight)
ToFCameraPMDRawDataCamBoardDevice()
DataCollection - Class to facilitate loading/accessing structured data.
PropertyList::Pointer m_PropertyList
a list of the corresponding properties
float * m_DistanceArray
float array holding the distance image
Interface to the Time-of-Flight (ToF) camera PMD CamBoard.
void GetAmplitudes(float *amplitudeArray, int &imageSequence)
Returns amplitude data.
bool ConnectCamera()
Establishes camera connection and sets the class variables.
Abstract base class for properties.
bool m_CameraActive
flag indicating if the camera is currently active or not. Caution: thread safe access only! ...
int m_CurrentPos
current position in the buffer which will be retrieved by the Get methods
void GetIntensities(float *intensityArray, int &imageSequence)
Returns intensity data.
virtual void AllocateSourceData()
method for allocating m_SourceDataArray and m_SourceDataBuffer
int m_CaptureWidth
width of the range image (x dimension)
int m_BufferSize
buffer size of the image buffer needed for loss-less acquisition of range data
virtual void SetProperty(const char *propertyKey, BaseProperty *propertyValue)
set a BaseProperty
static bool in(Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4)
ToFCameraPMDController::Pointer m_Controller
corresponding CameraController
int m_CaptureHeight
height of the range image (y dimension)
virtual void AllocatePixelArrays()
method for allocating memory for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray ...
float * m_AmplitudeArray
float array holding the amplitude image
virtual void SetChannelSize(int _arg)
unsigned int m_OriginControllerWidth
holds the original controller width
virtual int GetCaptureWidth()
get the currently set capture width
void GetAllImages(float *distanceArray, float *amplitudeArray, float *intensityArray, char *sourceDataArray, int requiredImageSequence, int &capturedImageSequence, unsigned char *rgbDataArray=nullptr)
Returns all image data at once.
int m_ImageSequence
counter for acquired images