Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::ToFImageGrabber Class Reference

Image source providing ToF images. Interface for filters provided in ToFProcessing module. More...

#include <mitkToFImageGrabber.h>

Inheritance diagram for mitk::ToFImageGrabber:
Collaboration diagram for mitk::ToFImageGrabber:

Public Member Functions

 mitkClassMacro (ToFImageGrabber, ImageSource)
 
Pointer Clone () const
 
void ShowDebugImage (float *distances)
 
virtual bool ConnectCamera ()
 Establish a connection to the ToF camera. More...
 
virtual bool DisconnectCamera ()
 Disconnects the ToF 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 bool IsCameraActive ()
 Returns true if the camera is connected and started. More...
 
virtual bool IsCameraConnected ()
 Returns true if the camera is connected. More...
 
void SetCameraDevice (ToFCameraDevice *aToFCameraDevice)
 Sets the ToF device, the image grabber is grabbing the images from. More...
 
ToFCameraDeviceGetCameraDevice ()
 Get the currently set ToF camera device. More...
 
int SetModulationFrequency (int modulationFrequency)
 Set the modulation frequency used by the ToF camera. For default values see the corresponding device classes. More...
 
int GetModulationFrequency ()
 Get the modulation frequency used by the ToF camera. More...
 
int SetIntegrationTime (int integrationTime)
 Set the integration time used by the ToF camera. For default values see the corresponding device classes. More...
 
int GetIntegrationTime ()
 Get the integration time in used by the ToF camera. More...
 
int GetCaptureWidth ()
 Get the dimension in x direction of the ToF image. More...
 
int GetCaptureHeight ()
 Get the dimension in y direction of the ToF image. More...
 
int GetPixelNumber ()
 Get the number of pixel in the ToF image. More...
 
int GetRGBImageWidth ()
 Get the dimension in x direction of the ToF image. More...
 
int GetRGBImageHeight ()
 Get the dimension in y direction of the ToF image. More...
 
int GetRGBPixelNumber ()
 Get the number of pixel in the ToF image. More...
 
void SetBoolProperty (const char *propertyKey, bool boolValue)
 
void SetIntProperty (const char *propertyKey, int intValue)
 
void SetFloatProperty (const char *propertyKey, float floatValue)
 
void SetStringProperty (const char *propertyKey, const char *stringValue)
 
void SetProperty (const char *propertyKey, BaseProperty *propertyValue)
 
bool GetBoolProperty (const char *propertyKey)
 
int GetIntProperty (const char *propertyKey)
 
float GetFloatProperty (const char *propertyKey)
 
const char * GetStringProperty (const char *propertyKey)
 
BasePropertyGetProperty (const char *propertyKey)
 
- Public Member Functions inherited from mitk::ToFImageSource
 mitkClassMacro (ToFImageSource, ImageSource)
 
Pointer Clone () const
 
- Public Member Functions inherited from mitk::ImageSource
virtual std::vector< std::string > GetClassHierarchy () const override
 
virtual const char * GetClassName () const
 
Pointer Clone () const
 
OutputTypeGetOutput ()
 Get the output data of this image source object. More...
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (DataObjectPointerArraySizeType idx) const
 
virtual itk::DataObject::Pointer MakeOutput (DataObjectPointerArraySizeType idx) override
 Make a DataObject of the correct type to used as the specified output. More...
 
virtual itk::DataObject::Pointer MakeOutput (const DataObjectIdentifierType &name) override
 
virtual vtkImageData * GetVtkImageData ()
 
virtual const vtkImageData * GetVtkImageData () const
 
- Public Member Functions inherited from mitk::BaseDataSource
OutputTypeGetOutput ()
 
const OutputTypeGetOutput () const
 
OutputTypeGetOutput (DataObjectPointerArraySizeType idx)
 
const OutputTypeGetOutput (DataObjectPointerArraySizeType idx) const
 
virtual void GraftOutput (OutputType *output)
 Graft the specified BaseData onto this BaseDataSource's output. More...
 
virtual void GraftOutput (const DataObjectIdentifierType &key, OutputType *output)
 
virtual void GraftNthOutput (unsigned int idx, OutputType *output)
 Graft the specified base data object onto this BaseDataSource's idx'th output. More...
 
bool Updating () const
 Access itk::ProcessObject::m_Updating. More...
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from mitk::ToFImageSource
static Pointer New ()
 
- Static Public Member Functions inherited from mitk::ImageSource
static const char * GetStaticNameOfClass ()
 
static Pointer New ()
 Method for creation through the object factory. More...
 
- Static Public Member Functions inherited from mitk::BaseDataSource
static const char * GetStaticNameOfClass ()
 

Protected Member Functions

void OnToFCameraDeviceModified ()
 
virtual void CleanUpImageArrays ()
 clean up memory allocated for the image arrays m_IntensityArray, m_DistanceArray, m_AmplitudeArray and m_SourceDataArray More...
 
virtual void AllocateImageArrays ()
 Allocate memory for the image arrays m_IntensityArray, m_DistanceArray, m_AmplitudeArray and m_SourceDataArray. More...
 
void InitializeImages ()
 InitializeImages Initialze the geometries of the images according to the device properties. More...
 
 ToFImageGrabber ()
 
 ~ToFImageGrabber ()
 
void GenerateData () override
 Method generating the outputs of this filter. Called in the updated process of the pipeline. 0: distance image 1: amplitude image 2: intensity image 3: RGB image. More...
 
- Protected Member Functions inherited from mitk::ToFImageSource
 ToFImageSource ()
 
 ~ToFImageSource ()
 
- Protected Member Functions inherited from mitk::ImageSource
 ImageSource ()
 
virtual ~ImageSource ()
 
virtual void ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType threadId)
 If an imaging filter can be implemented as a multithreaded algorithm, the filter will provide an implementation of ThreadedGenerateData(). More...
 
virtual void PrepareOutputs () override
 This method is intentionally left blank. More...
 
virtual void AllocateOutputs ()
 The GenerateData method normally allocates the buffers for all of the outputs of a filter. More...
 
virtual void BeforeThreadedGenerateData ()
 If an imaging filter needs to perform processing after the buffer has been allocated but before threads are spawned, the filter can can provide an implementation for BeforeThreadedGenerateData(). More...
 
virtual void AfterThreadedGenerateData ()
 If an imaging filter needs to perform processing after all processing threads have completed, the filter can can provide an implementation for AfterThreadedGenerateData(). More...
 
virtual unsigned int SplitRequestedRegion (unsigned int i, unsigned int num, OutputImageRegionType &splitRegion)
 Split the output's RequestedRegion into "num" pieces, returning region "i" as "splitRegion". More...
 
- Protected Member Functions inherited from mitk::BaseDataSource
 BaseDataSource ()
 
virtual ~BaseDataSource ()
 

Protected Attributes

ToFCameraDevice::Pointer m_ToFCameraDevice
 Device allowing access to ToF image data. More...
 
int m_CaptureWidth
 Width of the captured ToF image. More...
 
int m_CaptureHeight
 Height of the captured ToF image. More...
 
int m_PixelNumber
 Number of pixels in the image. More...
 
int m_RGBImageWidth
 Width of the captured RGB image. More...
 
int m_RGBImageHeight
 Height of the captured RGB image. More...
 
int m_RGBPixelNumber
 Number of pixels in the RGB image. More...
 
int m_ImageSequence
 counter for currently acquired images More...
 
int m_SourceDataSize
 size of the source data in bytes More...
 
float * m_IntensityArray
 member holding the current intensity array More...
 
float * m_DistanceArray
 member holding the current distance array More...
 
float * m_AmplitudeArray
 member holding the current amplitude array More...
 
char * m_SourceDataArray
 member holding the current source data array More...
 
unsigned char * m_RgbDataArray
 member holding the current rgb data array More...
 
unsigned long m_DeviceObserverTag
 tag of the observer for the ToFCameraDevice More...
 
- Protected Attributes inherited from mitk::ToFImageSource
us::ServiceRegistration< Selfm_ServiceRegistration
 

Additional Inherited Members

- Public Types inherited from mitk::ImageSource
typedef ImageSource Self
 
typedef BaseDataSource Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef mitk::Image OutputImageType
 Some convenient typedefs. More...
 
typedef OutputImageType OutputType
 
typedef OutputImageType::Pointer OutputImagePointer
 
typedef SlicedData::RegionType OutputImageRegionType
 
- Public Types inherited from mitk::BaseDataSource
typedef BaseDataSource Self
 
typedef itk::ProcessObject Superclass
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef BaseData OutputType
 
typedef itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType
 
- Static Protected Member Functions inherited from mitk::ImageSource
static ITK_THREAD_RETURN_TYPE ThreaderCallback (void *arg)
 Static function used as a "callback" by the MultiThreader. More...
 
- Static Protected Member Functions inherited from mitk::BaseDataSource
static Pointer New ()
 

Detailed Description

Image source providing ToF images. Interface for filters provided in ToFProcessing module.

Documentation This class internally holds a ToFCameraDevice to access the images acquired by a ToF camera.

Provided images include: distance image (output 0), amplitude image (output 1), intensity image (output 2)

Definition at line 38 of file mitkToFImageGrabber.h.

Constructor & Destructor Documentation

mitk::ToFImageGrabber::ToFImageGrabber ( )
protected

Definition at line 23 of file mitkToFImageGrabber.cpp.

References mitk::ImageSource::MakeOutput().

mitk::ToFImageGrabber::~ToFImageGrabber ( )
protected

Member Function Documentation

void mitk::ToFImageGrabber::AllocateImageArrays ( )
protectedvirtual

Allocate memory for the image arrays m_IntensityArray, m_DistanceArray, m_AmplitudeArray and m_SourceDataArray.

Definition at line 321 of file mitkToFImageGrabber.cpp.

References CleanUpImageArrays(), m_AmplitudeArray, m_DistanceArray, m_IntensityArray, m_PixelNumber, m_RgbDataArray, m_RGBPixelNumber, m_SourceDataArray, and m_SourceDataSize.

Referenced by ConnectCamera().

void mitk::ToFImageGrabber::CleanUpImageArrays ( )
protectedvirtual

clean up memory allocated for the image arrays m_IntensityArray, m_DistanceArray, m_AmplitudeArray and m_SourceDataArray

Definition at line 291 of file mitkToFImageGrabber.cpp.

References m_AmplitudeArray, m_DistanceArray, m_IntensityArray, m_RgbDataArray, and m_SourceDataArray.

Referenced by AllocateImageArrays(), and ~ToFImageGrabber().

Pointer mitk::ToFImageGrabber::Clone ( ) const
bool mitk::ToFImageGrabber::ConnectCamera ( )
virtual
bool mitk::ToFImageGrabber::DisconnectCamera ( )
virtual

Disconnects the ToF camera.

Definition at line 127 of file mitkToFImageGrabber.cpp.

References m_ToFCameraDevice.

Referenced by ~ToFImageGrabber().

void mitk::ToFImageGrabber::GenerateData ( )
overrideprotectedvirtual

Method generating the outputs of this filter. Called in the updated process of the pipeline. 0: distance image 1: amplitude image 2: intensity image 3: RGB image.

Reimplemented from mitk::ImageSource.

Definition at line 66 of file mitkToFImageGrabber.cpp.

References mitk::ImageSource::GetOutput(), m_AmplitudeArray, m_DistanceArray, m_ImageSequence, m_IntensityArray, m_RgbDataArray, m_SourceDataArray, and m_ToFCameraDevice.

bool mitk::ToFImageGrabber::GetBoolProperty ( const char *  propertyKey)

Definition at line 256 of file mitkToFImageGrabber.cpp.

References GetProperty().

ToFCameraDevice * mitk::ToFImageGrabber::GetCameraDevice ( )

Get the currently set ToF camera device.

Returns
device currently used for grabbing images from the camera

Definition at line 166 of file mitkToFImageGrabber.cpp.

References m_ToFCameraDevice.

int mitk::ToFImageGrabber::GetCaptureHeight ( )

Get the dimension in y direction of the ToF image.

Returns
height of the image

Definition at line 176 of file mitkToFImageGrabber.cpp.

References m_CaptureHeight.

int mitk::ToFImageGrabber::GetCaptureWidth ( )

Get the dimension in x direction of the ToF image.

Returns
width of the image

Definition at line 171 of file mitkToFImageGrabber.cpp.

References m_CaptureWidth.

float mitk::ToFImageGrabber::GetFloatProperty ( const char *  propertyKey)

Definition at line 269 of file mitkToFImageGrabber.cpp.

References GetProperty().

int mitk::ToFImageGrabber::GetIntegrationTime ( )

Get the integration time in used by the ToF camera.

Returns
integration time in ms

Definition at line 217 of file mitkToFImageGrabber.cpp.

References m_ToFCameraDevice.

Referenced by QmitkToFPMDParameterWidget::ActivateAllParameters(), and SetIntegrationTime().

int mitk::ToFImageGrabber::GetIntProperty ( const char *  propertyKey)

Definition at line 263 of file mitkToFImageGrabber.cpp.

References GetProperty().

int mitk::ToFImageGrabber::GetModulationFrequency ( )

Get the modulation frequency used by the ToF camera.

Returns
modulation frequency in MHz

Definition at line 224 of file mitkToFImageGrabber.cpp.

References m_ToFCameraDevice.

Referenced by QmitkToFPMDParameterWidget::ActivateAllParameters(), and SetModulationFrequency().

int mitk::ToFImageGrabber::GetPixelNumber ( )

Get the number of pixel in the ToF image.

Returns
number of pixel

Definition at line 181 of file mitkToFImageGrabber.cpp.

References m_PixelNumber.

BaseProperty * mitk::ToFImageGrabber::GetProperty ( const char *  propertyKey)
int mitk::ToFImageGrabber::GetRGBImageHeight ( )

Get the dimension in y direction of the ToF image.

Returns
height of the image

Definition at line 191 of file mitkToFImageGrabber.cpp.

References m_RGBImageHeight.

int mitk::ToFImageGrabber::GetRGBImageWidth ( )

Get the dimension in x direction of the ToF image.

Returns
width of the image

Definition at line 186 of file mitkToFImageGrabber.cpp.

References m_RGBImageWidth.

int mitk::ToFImageGrabber::GetRGBPixelNumber ( )

Get the number of pixel in the ToF image.

Returns
number of pixel

Definition at line 196 of file mitkToFImageGrabber.cpp.

References m_RGBPixelNumber.

const char * mitk::ToFImageGrabber::GetStringProperty ( const char *  propertyKey)

Definition at line 275 of file mitkToFImageGrabber.cpp.

References GetProperty().

void mitk::ToFImageGrabber::InitializeImages ( )
protected

InitializeImages Initialze the geometries of the images according to the device properties.

Definition at line 333 of file mitkToFImageGrabber.cpp.

References mitk::ImageSource::GetOutput(), m_ToFCameraDevice, and mitk::MakePixelType().

Referenced by ConnectCamera().

bool mitk::ToFImageGrabber::IsCameraConnected ( )
virtual

Returns true if the camera is connected.

Definition at line 152 of file mitkToFImageGrabber.cpp.

References m_ToFCameraDevice.

mitk::ToFImageGrabber::mitkClassMacro ( ToFImageGrabber  ,
ImageSource   
)
static Pointer mitk::ToFImageGrabber::New ( )
static
void mitk::ToFImageGrabber::OnToFCameraDeviceModified ( )
protected

called when the ToFCameraDevice was modified

Definition at line 286 of file mitkToFImageGrabber.cpp.

Referenced by SetCameraDevice().

void mitk::ToFImageGrabber::SetCameraDevice ( ToFCameraDevice aToFCameraDevice)

Sets the ToF device, the image grabber is grabbing the images from.

Parameters
aToFCameraDevicedevice internally used for grabbing the images from the camera

Definition at line 157 of file mitkToFImageGrabber.cpp.

References m_DeviceObserverTag, m_ToFCameraDevice, mitk::New(), and OnToFCameraDeviceModified().

void mitk::ToFImageGrabber::SetFloatProperty ( const char *  propertyKey,
float  floatValue 
)

Definition at line 241 of file mitkToFImageGrabber.cpp.

References mitk::FloatProperty::New(), and SetProperty().

int mitk::ToFImageGrabber::SetIntegrationTime ( int  integrationTime)

Set the integration time used by the ToF camera. For default values see the corresponding device classes.

Parameters
integrationTimeintegration time in ms

Definition at line 209 of file mitkToFImageGrabber.cpp.

References GetIntegrationTime(), m_ToFCameraDevice, and mitk::IntProperty::New().

Referenced by QmitkToFMESAParameterWidget::ActivateAllParameters(), QmitkToFPMDParameterWidget::ActivateAllParameters(), QmitkToFPMDParameterWidget::OnChangeIntegrationTimeSpinBox(), and QmitkToFMESAParameterWidget::OnChangeIntegrationTimeSpinBox().

void mitk::ToFImageGrabber::SetIntProperty ( const char *  propertyKey,
int  intValue 
)

Definition at line 236 of file mitkToFImageGrabber.cpp.

References mitk::IntProperty::New(), and SetProperty().

int mitk::ToFImageGrabber::SetModulationFrequency ( int  modulationFrequency)

Set the modulation frequency used by the ToF camera. For default values see the corresponding device classes.

Parameters
modulationFrequencymodulation frequency in Hz

Definition at line 201 of file mitkToFImageGrabber.cpp.

References GetModulationFrequency(), m_ToFCameraDevice, and mitk::IntProperty::New().

Referenced by QmitkToFMESAParameterWidget::ActivateAllParameters(), QmitkToFPMDParameterWidget::ActivateAllParameters(), QmitkToFMESAParameterWidget::OnChangeModulationFrequencyComboBox(), and QmitkToFPMDParameterWidget::OnChangeModulationFrequencySpinBox().

void mitk::ToFImageGrabber::SetProperty ( const char *  propertyKey,
BaseProperty propertyValue 
)
void mitk::ToFImageGrabber::SetStringProperty ( const char *  propertyKey,
const char *  stringValue 
)

Definition at line 246 of file mitkToFImageGrabber.cpp.

References mitk::StringProperty::New(), and SetProperty().

void mitk::ToFImageGrabber::ShowDebugImage ( float *  distances)
void mitk::ToFImageGrabber::StartCamera ( )
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.

Definition at line 132 of file mitkToFImageGrabber.cpp.

References us::GetModuleContext(), mitk::ToFImageSource::m_ServiceRegistration, and m_ToFCameraDevice.

Referenced by QmitkToFMESAParameterWidget::OnChangeIntegrationTimeSpinBox(), QmitkToFPMDParameterWidget::OnChangeIntegrationTimeSpinBox(), QmitkToFMESAParameterWidget::OnChangeModulationFrequencyComboBox(), and QmitkToFPMDParameterWidget::OnChangeModulationFrequencySpinBox().

Member Data Documentation

float* mitk::ToFImageGrabber::m_AmplitudeArray
protected

member holding the current amplitude array

Definition at line 190 of file mitkToFImageGrabber.h.

Referenced by AllocateImageArrays(), CleanUpImageArrays(), GenerateData(), and ~ToFImageGrabber().

int mitk::ToFImageGrabber::m_CaptureHeight
protected

Height of the captured ToF image.

Definition at line 181 of file mitkToFImageGrabber.h.

Referenced by ConnectCamera(), and GetCaptureHeight().

int mitk::ToFImageGrabber::m_CaptureWidth
protected

Width of the captured ToF image.

Definition at line 180 of file mitkToFImageGrabber.h.

Referenced by ConnectCamera(), and GetCaptureWidth().

unsigned long mitk::ToFImageGrabber::m_DeviceObserverTag
protected

tag of the observer for the ToFCameraDevice

Definition at line 193 of file mitkToFImageGrabber.h.

Referenced by SetCameraDevice(), and ~ToFImageGrabber().

float* mitk::ToFImageGrabber::m_DistanceArray
protected

member holding the current distance array

Definition at line 189 of file mitkToFImageGrabber.h.

Referenced by AllocateImageArrays(), CleanUpImageArrays(), GenerateData(), and ~ToFImageGrabber().

int mitk::ToFImageGrabber::m_ImageSequence
protected

counter for currently acquired images

Definition at line 186 of file mitkToFImageGrabber.h.

Referenced by GenerateData().

float* mitk::ToFImageGrabber::m_IntensityArray
protected

member holding the current intensity array

Definition at line 188 of file mitkToFImageGrabber.h.

Referenced by AllocateImageArrays(), CleanUpImageArrays(), GenerateData(), and ~ToFImageGrabber().

int mitk::ToFImageGrabber::m_PixelNumber
protected

Number of pixels in the image.

Definition at line 182 of file mitkToFImageGrabber.h.

Referenced by AllocateImageArrays(), ConnectCamera(), and GetPixelNumber().

unsigned char* mitk::ToFImageGrabber::m_RgbDataArray
protected

member holding the current rgb data array

Definition at line 192 of file mitkToFImageGrabber.h.

Referenced by AllocateImageArrays(), CleanUpImageArrays(), GenerateData(), and ~ToFImageGrabber().

int mitk::ToFImageGrabber::m_RGBImageHeight
protected

Height of the captured RGB image.

Definition at line 184 of file mitkToFImageGrabber.h.

Referenced by ConnectCamera(), and GetRGBImageHeight().

int mitk::ToFImageGrabber::m_RGBImageWidth
protected

Width of the captured RGB image.

Definition at line 183 of file mitkToFImageGrabber.h.

Referenced by ConnectCamera(), and GetRGBImageWidth().

int mitk::ToFImageGrabber::m_RGBPixelNumber
protected

Number of pixels in the RGB image.

Definition at line 185 of file mitkToFImageGrabber.h.

Referenced by AllocateImageArrays(), ConnectCamera(), and GetRGBPixelNumber().

char* mitk::ToFImageGrabber::m_SourceDataArray
protected

member holding the current source data array

Definition at line 191 of file mitkToFImageGrabber.h.

Referenced by AllocateImageArrays(), CleanUpImageArrays(), and GenerateData().

int mitk::ToFImageGrabber::m_SourceDataSize
protected

size of the source data in bytes

Definition at line 187 of file mitkToFImageGrabber.h.

Referenced by AllocateImageArrays(), and ConnectCamera().


The documentation for this class was generated from the following files: