13 #include <itkCommand.h> 20 m_ToFCameraDevice(nullptr),
29 m_IntensityArray(nullptr),
30 m_DistanceArray(nullptr),
31 m_AmplitudeArray(nullptr),
32 m_SourceDataArray(nullptr),
33 m_RgbDataArray(nullptr),
42 mitk::ImageSource::SetNumberOfRequiredOutputs(3);
43 mitk::ImageSource::SetNthOutput(0, output0.GetPointer());
44 mitk::ImageSource::SetNthOutput(1, output1.GetPointer());
45 mitk::ImageSource::SetNthOutput(2, output2.GetPointer());
46 mitk::ImageSource::SetNthOutput(3, output3.GetPointer());
64 int requiredImageSequence = 0;
75 bool hasAmplitudeImage =
false;
83 bool hasIntensityImage =
false;
91 bool hasRGBImage =
false;
133 deviceProps[
"ToFImageSourceName"] = std::string(
"Image Grabber");
156 itk::SimpleMemberCommand<ToFImageGrabber>::Pointer modifiedCommand = itk::SimpleMemberCommand<ToFImageGrabber>::New();
202 return modulationFrequency;
210 return integrationTime;
215 int integrationTime = 0;
217 return integrationTime;
222 int modulationFrequency = 0;
223 this->
m_ToFCameraDevice->GetIntProperty(
"ModulationFrequency",modulationFrequency);
224 return modulationFrequency;
255 if(!boolProp)
return false;
256 return boolProp->GetValue();
262 return intProp->GetValue();
268 return floatProp->GetValue();
274 return stringProp->GetValue();
331 unsigned int dimensions[3];
337 distanceImage->ReleaseData();
338 distanceImage->Initialize(FloatType, 3, dimensions, 1);
340 bool hasAmplitudeImage =
false;
342 if(hasAmplitudeImage)
345 amplitudeImage->ReleaseData();
346 amplitudeImage->Initialize(FloatType, 3, dimensions, 1);
349 bool hasIntensityImage =
false;
351 if(hasIntensityImage)
354 intensityImage->ReleaseData();
355 intensityImage->Initialize(FloatType, 3, dimensions, 1);
358 bool hasRGBImage =
false;
362 unsigned int rgbDimension[3];
365 rgbDimension[2] = 1 ;
367 rgbImage->ReleaseData();
void SetProperty(const char *propertyKey, BaseProperty *propertyValue)
virtual void StopCamera()
Stops the continuous updating of the camera.
void SetIntProperty(const char *propertyKey, int intValue)
float * m_DistanceArray
member holding the current distance array
int m_RGBImageWidth
Width of the captured RGB image.
virtual bool IsCameraConnected()
Returns true if the camera is connected.
int m_ImageSequence
counter for currently acquired images
int m_RGBPixelNumber
Number of pixels in the RGB image.
itk::DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType idx) override
Make a DataObject of the correct type to used as the specified output.
int SetIntegrationTime(int integrationTime)
Set the integration time used by the ToF camera. For default values see the corresponding device clas...
float GetFloatProperty(const char *propertyKey)
int GetCaptureHeight()
Get the dimension in y direction of the ToF image.
void SetFloatProperty(const char *propertyKey, float floatValue)
int m_RGBImageHeight
Height of the captured RGB image.
Virtual interface and base class for all Time-of-Flight devices.
virtual void AllocateImageArrays()
Allocate memory for the image arrays m_IntensityArray, m_DistanceArray, m_AmplitudeArray and m_Source...
virtual bool IsCameraActive()
Returns true if the camera is connected and started.
us::ServiceRegistration< Self > m_ServiceRegistration
BaseProperty * GetProperty(const char *propertyKey)
DataCollection - Class to facilitate loading/accessing structured data.
ToFCameraDevice * GetCameraDevice()
Get the currently set ToF camera device.
void OnToFCameraDeviceModified()
int m_CaptureWidth
Width of the captured ToF image.
float * m_IntensityArray
member holding the current intensity array
virtual bool DisconnectCamera()
Disconnects the ToF camera.
void SetCameraDevice(ToFCameraDevice *aToFCameraDevice)
Sets the ToF device, the image grabber is grabbing the images from.
int GetPixelNumber()
Get the number of pixel in the ToF image.
char * m_SourceDataArray
member holding the current source data array
int GetRGBPixelNumber()
Get the number of pixel in the ToF image.
virtual void StartCamera()
Starts the continuous updating of the camera. A separate thread updates the source data...
int GetRGBImageHeight()
Get the dimension in y direction of the ToF image.
MITKCORE_EXPORT mitk::PixelType MakePixelType(vtkImageData *vtkimagedata)
deduct the PixelType for a given vtk image
void SetStringProperty(const char *propertyKey, const char *stringValue)
Abstract base class for properties.
int GetCaptureWidth()
Get the dimension in x direction of the ToF image.
ToFCameraDevice::Pointer m_ToFCameraDevice
Device allowing access to ToF image data.
void SetBoolProperty(const char *propertyKey, bool boolValue)
Image class for storing images.
int GetIntProperty(const char *propertyKey)
int SetModulationFrequency(int modulationFrequency)
Set the modulation frequency used by the ToF camera. For default values see the corresponding device ...
void InitializeImages()
InitializeImages Initialze the geometries of the images according to the device properties.
int GetIntegrationTime()
Get the integration time in used by the ToF camera.
int GetRGBImageWidth()
Get the dimension in x direction of the ToF image.
US_UNORDERED_MAP_TYPE< std::string, Any > ServiceProperties
~ToFImageGrabber() override
Image source providing ToF images. Interface for filters provided in ToFProcessing module...
int m_SourceDataSize
size of the source data in bytes
unsigned long m_DeviceObserverTag
tag of the observer for the ToFCameraDevice
unsigned char * m_RgbDataArray
member holding the current rgb data array
virtual void CleanUpImageArrays()
clean up memory allocated for the image arrays m_IntensityArray, m_DistanceArray, m_AmplitudeArray an...
virtual bool ConnectCamera()
Establish a connection to the ToF camera.
int m_PixelNumber
Number of pixels in the image.
OutputType * GetOutput()
Get the output data of this image source object.
int GetModulationFrequency()
Get the modulation frequency used by the ToF camera.
const char * GetStringProperty(const char *propertyKey)
float * m_AmplitudeArray
member holding the current amplitude array
void GenerateData() override
Method generating the outputs of this filter. Called in the updated process of the pipeline...
static ModuleContext * GetModuleContext()
Returns the module context of the calling module.
int m_CaptureHeight
Height of the captured ToF image.
Class for defining the data type of pixels.
bool GetBoolProperty(const char *propertyKey)