Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkToFCameraDevice.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 #ifndef __mitkToFCameraDevice_h
17 #define __mitkToFCameraDevice_h
18 
19 #include <MitkToFHardwareExports.h>
20 #include "mitkCommon.h"
21 #include "mitkStringProperty.h"
22 #include "mitkProperties.h"
23 #include "mitkPropertyList.h"
24 
25 #include "itkObject.h"
26 #include "itkObjectFactory.h"
27 #include "itkMultiThreader.h"
28 #include "itkFastMutexLock.h"
29 
30 // Microservices
31 #include <mitkServiceInterface.h>
32 
33 namespace mitk
34 {
40  class MITKTOFHARDWARE_EXPORT ToFCameraDevice : public itk::Object
41  {
42  public:
43 
50  virtual bool OnConnectCamera() = 0;
51 
57  virtual bool ConnectCamera();
61  virtual bool DisconnectCamera() = 0;
66  virtual void StartCamera() = 0;
70  virtual void StopCamera();
74  virtual bool IsCameraActive();
78  virtual bool IsCameraConnected();
82  virtual void UpdateCamera() = 0;
89  virtual void GetAmplitudes(float* amplitudeArray, int& imageSequence) = 0;
95  virtual void GetIntensities(float* intensityArray, int& imageSequence) = 0;
101  virtual void GetDistances(float* distanceArray, int& imageSequence) = 0;
111  virtual void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray,
112  int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray=NULL) = 0;
117  itkGetMacro(CaptureWidth, int);
122  itkGetMacro(CaptureHeight, int);
127  itkGetMacro(SourceDataSize, int);
132  itkGetMacro(BufferSize, int);
137  itkGetMacro(MaxBufferSize, int);
138 
142  void SetBoolProperty( const char* propertyKey, bool boolValue );
143 
147  void SetIntProperty( const char* propertyKey, int intValue );
148 
152  void SetFloatProperty( const char* propertyKey, float floatValue );
153 
157  void SetStringProperty( const char* propertyKey, const char* stringValue );
158 
162  virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
163 
167  virtual BaseProperty* GetProperty( const char *propertyKey );
168 
172  bool GetBoolProperty(const char *propertyKey, bool& boolValue);
173 
177  bool GetStringProperty(const char *propertyKey, std::string& string);
178 
182  bool GetIntProperty(const char *propertyKey, int& integer);
183 
184  virtual int GetRGBCaptureWidth();
185 
186  virtual int GetRGBCaptureHeight();
187 
188  protected:
189 
190  ToFCameraDevice();
191 
192  ~ToFCameraDevice();
193 
197  virtual void AllocatePixelArrays();
201  virtual void CleanupPixelArrays();
202 
209  int m_FreePos;
224 
226 
227  };
228 } //END mitk namespace
233 MITK_DECLARE_SERVICE_INTERFACE(mitk::ToFCameraDevice, "org.mitk.services.ToFCameraDevice")
234 #endif
itk::SmartPointer< Self > Pointer
signed integer value
Definition: jsoncpp.h:348
Virtual interface and base class for all Time-of-Flight devices.
int m_SourceDataSize
size of the PMD source data
int m_RGBPixelNumber
number of pixels in the range image (m_RGBImageWidth*m_RGBImageHeight)
float * m_IntensityArray
float array holding the intensity image
int m_PixelNumber
number of pixels in the range image (m_CaptureWidth*m_CaptureHeight)
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
int m_ThreadID
ID of the started thread.
itk::FastMutexLock::Pointer m_CameraActiveMutex
mutex for the cameraActive flag
itk::MultiThreader::Pointer m_MultiThreader
itk::MultiThreader used for thread handling
int m_FreePos
current position in the buffer which will be filled with data acquired from the hardware ...
Abstract base class for properties.
int m_RGBImageHeight
height of the RGB image (y dimension)
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
bool m_CameraConnected
flag indicating if the camera is successfully connected or not. Caution: thread safe access only! ...
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
int m_CaptureWidth
width of the range image (x dimension)
itk::FastMutexLock::Pointer m_ImageMutex
mutex for images provided by the range camera
int m_BufferSize
buffer size of the image buffer needed for loss-less acquisition of range data
int m_MaxBufferSize
maximal buffer size needed for initialization of data arrays. Default value is 100.
int m_CaptureHeight
height of the range image (y dimension)
UTF-8 string value.
Definition: jsoncpp.h:351
float * m_AmplitudeArray
float array holding the amplitude image
int m_RGBImageWidth
width of the RGB image (x dimension)
MITK_DECLARE_SERVICE_INTERFACE(mitk::ISimulationService,"org.mitk.ISimulationService")
int m_ImageSequence
counter for acquired images