17 #include <itkCommand.h>
24 m_ToFCameraDevice(NULL),
33 m_IntensityArray(NULL),
34 m_DistanceArray(NULL),
35 m_AmplitudeArray(NULL),
36 m_SourceDataArray(NULL),
46 mitk::ImageSource::SetNumberOfRequiredOutputs(3);
47 mitk::ImageSource::SetNthOutput(0, output0.GetPointer());
48 mitk::ImageSource::SetNthOutput(1, output1.GetPointer());
49 mitk::ImageSource::SetNthOutput(2, output2.GetPointer());
50 mitk::ImageSource::SetNthOutput(3, output3.GetPointer());
68 int requiredImageSequence = 0;
79 bool hasAmplitudeImage =
false;
87 bool hasIntensityImage =
false;
95 bool hasRGBImage =
false;
137 deviceProps[
"ToFImageSourceName"] = std::string(
"Image Grabber");
206 return modulationFrequency;
214 return integrationTime;
219 int integrationTime = 0;
221 return integrationTime;
226 int modulationFrequency = 0;
227 this->
m_ToFCameraDevice->GetIntProperty(
"ModulationFrequency",modulationFrequency);
228 return modulationFrequency;
259 if(!boolProp)
return false;
260 return boolProp->GetValue();
266 return intProp->GetValue();
272 return floatProp->GetValue();
278 return stringProp->GetValue();
335 unsigned int dimensions[3];
341 distanceImage->ReleaseData();
342 distanceImage->Initialize(FloatType, 3, dimensions, 1);
344 bool hasAmplitudeImage =
false;
346 if(hasAmplitudeImage)
349 amplitudeImage->ReleaseData();
350 amplitudeImage->Initialize(FloatType, 3, dimensions, 1);
353 bool hasIntensityImage =
false;
355 if(hasIntensityImage)
358 intensityImage->ReleaseData();
359 intensityImage->Initialize(FloatType, 3, dimensions, 1);
362 bool hasRGBImage =
false;
366 unsigned int rgbDimension[3];
369 rgbDimension[2] = 1 ;
371 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.
itk::SmartPointer< Self > Pointer
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.
virtual 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
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)
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.