Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
mitkToFCameraMITKPlayerController.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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 #ifndef mitkToFCameraMITKPlayerController_h
13 #define mitkToFCameraMITKPlayerController_h
14 
15 #include <MitkToFHardwareExports.h>
16 #include "mitkCommon.h"
17 #include "mitkFileReader.h"
18 #include "mitkImage.h"
19 
20 #include "itkObject.h"
21 #include "itkObjectFactory.h"
22 
23 
24 namespace mitk
25 {
31  class MITKTOFHARDWARE_EXPORT ToFCameraMITKPlayerController : public itk::Object
32  {
33  public:
34 
36 
37  itkFactorylessNewMacro(Self);
38 
39  itkCloneMacro(Self);
40 
45  virtual bool OpenCameraConnection();
50  virtual bool CloseCameraConnection();
55  virtual void GetAmplitudes(float* amplitudeArray);
59  virtual void GetIntensities(float* intensityArray);
63  virtual void GetDistances(float* distanceArray);
67  virtual void GetRgb(unsigned char* rgbArray);
71  virtual void UpdateCamera();
72 
73  virtual void SetInputFileName(std::string inputFileName);
74 
75  itkGetMacro(PixelNumber, int);
76  itkGetMacro(RGBPixelNumber, int);
77  itkGetMacro(CaptureWidth, int);
78  itkGetMacro(CaptureHeight, int);
79  itkGetMacro(RGBCaptureWidth, int);
80  itkGetMacro(RGBCaptureHeight, int);
81  itkGetMacro( DistanceImageFileName, std::string );
82  itkGetMacro( AmplitudeImageFileName, std::string );
83  itkGetMacro( IntensityImageFileName, std::string );
84  itkGetMacro( RGBImageFileName, std::string );
85 
86  itkSetMacro( DistanceImageFileName, std::string );
87  itkSetMacro( AmplitudeImageFileName, std::string );
88  itkSetMacro( IntensityImageFileName, std::string );
89  itkSetMacro( RGBImageFileName, std::string );
90  enum ToFImageType{ ToFImageType3D, ToFImageType2DPlusT };
91 
92  protected:
93 
95 
97 
107 
108  std::string m_InputFileName;
110 
115  std::vector<bool> m_ImageStatus;
116 
120  FILE* m_RGBInfile;
121 
125  unsigned char* m_RGBArray;
126 
130  std::string m_RGBImageFileName;
131 
135 
136  private:
137 
138  void AccessData(int frame, Image::Pointer image, float* &data);
139  void CleanUp();
140  };
141 } //END mitk namespace
142 #endif
mitk::ToFCameraMITKPlayerController::m_CaptureWidth
int m_CaptureWidth
holds the width of the image
Definition: mitkToFCameraMITKPlayerController.h:102
mitk::ToFCameraMITKPlayerController::m_NumOfFrames
int m_NumOfFrames
Definition: mitkToFCameraMITKPlayerController.h:134
mitk::ToFCameraMITKPlayerController::m_RGBArray
unsigned char * m_RGBArray
member holding the current rgb frame
Definition: mitkToFCameraMITKPlayerController.h:125
mitkImage.h
mitk::ToFCameraMITKPlayerController::m_RGBInfile
FILE * m_RGBInfile
file holding the rgb data
Definition: mitkToFCameraMITKPlayerController.h:120
mitk::ToFCameraMITKPlayerController::m_RGBCaptureHeight
int m_RGBCaptureHeight
same for RGB image which can be different then depth etc.
Definition: mitkToFCameraMITKPlayerController.h:105
mitk::ToFCameraMITKPlayerController::m_AmplitudeInfile
FILE * m_AmplitudeInfile
file holding the amplitude data
Definition: mitkToFCameraMITKPlayerController.h:118
mitk::ToFCameraMITKPlayerController::m_AmplitudeImage
Image::Pointer m_AmplitudeImage
Definition: mitkToFCameraMITKPlayerController.h:112
mitkFileReader.h
itk::SmartPointer< Self >
mitk::ToFCameraMITKPlayerController::m_RGBImageFileName
std::string m_RGBImageFileName
file name of the rgb image to be played
Definition: mitkToFCameraMITKPlayerController.h:130
mitk::ToFCameraMITKPlayerController
Controller for playing ToF images saved in NRRD format.
Definition: mitkToFCameraMITKPlayerController.h:31
mitk::ToFCameraMITKPlayerController::m_IntensityImage
Image::Pointer m_IntensityImage
Definition: mitkToFCameraMITKPlayerController.h:113
mitk::ToFCameraMITKPlayerController::m_DistanceImage
Image::Pointer m_DistanceImage
Definition: mitkToFCameraMITKPlayerController.h:111
mitk::ToFCameraMITKPlayerController::m_NumberOfBytes
int m_NumberOfBytes
holds the number of bytes contained in the image
Definition: mitkToFCameraMITKPlayerController.h:100
mitk::ToFCameraMITKPlayerController::m_IntensityInfile
FILE * m_IntensityInfile
file holding the intensity data
Definition: mitkToFCameraMITKPlayerController.h:119
mitk::ToFCameraMITKPlayerController::ToFImageType3D
@ ToFImageType3D
Definition: mitkToFCameraMITKPlayerController.h:90
mitkClassMacroItkParent
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
mitk::ToFCameraMITKPlayerController::m_RGBPixelNumber
int m_RGBPixelNumber
same for RGB image
Definition: mitkToFCameraMITKPlayerController.h:99
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::ToFCameraMITKPlayerController::m_ConnectionCheck
bool m_ConnectionCheck
flag showing whether the camera is connected (true) or not (false)
Definition: mitkToFCameraMITKPlayerController.h:106
mitk::ToFCameraMITKPlayerController::m_InputFileName
std::string m_InputFileName
Definition: mitkToFCameraMITKPlayerController.h:108
mitk::ToFCameraMITKPlayerController::m_AmplitudeArray
float * m_AmplitudeArray
member holding the current amplitude frame
Definition: mitkToFCameraMITKPlayerController.h:124
mitk::ToFCameraMITKPlayerController::m_CaptureHeight
int m_CaptureHeight
holds the height of the image
Definition: mitkToFCameraMITKPlayerController.h:103
mitk::ToFCameraMITKPlayerController::m_ToFImageType
ToFImageType m_ToFImageType
type of the ToF image to be played: 3D Volume (ToFImageType3D), temporal 2D image stack (ToFImageType...
Definition: mitkToFCameraMITKPlayerController.h:109
mitk::ToFCameraMITKPlayerController::m_DistanceImageFileName
std::string m_DistanceImageFileName
file name of the distance image to be played
Definition: mitkToFCameraMITKPlayerController.h:127
mitk::ToFCameraMITKPlayerController::m_RGBCaptureWidth
int m_RGBCaptureWidth
same for RGB image which can be different then depth etc.
Definition: mitkToFCameraMITKPlayerController.h:104
mitk::ToFCameraMITKPlayerController::m_DistanceInfile
FILE * m_DistanceInfile
file holding the distance data
Definition: mitkToFCameraMITKPlayerController.h:117
mitkCommon.h
mitk::ToFCameraMITKPlayerController::m_NumberOfRGBBytes
int m_NumberOfRGBBytes
same for RGB image
Definition: mitkToFCameraMITKPlayerController.h:101
mitk::ToFCameraMITKPlayerController::ToFImageType
ToFImageType
Definition: mitkToFCameraMITKPlayerController.h:90
mitk::ToFCameraMITKPlayerController::m_IntensityImageFileName
std::string m_IntensityImageFileName
file name of the intensity image to be played
Definition: mitkToFCameraMITKPlayerController.h:129
mitk::ToFCameraMITKPlayerController::m_ImageStatus
std::vector< bool > m_ImageStatus
Definition: mitkToFCameraMITKPlayerController.h:115
mitk::ToFCameraMITKPlayerController::m_AmplitudeImageFileName
std::string m_AmplitudeImageFileName
file name of the amplitude image to be played
Definition: mitkToFCameraMITKPlayerController.h:128
mitk::ToFCameraMITKPlayerController::m_CurrentFrame
int m_CurrentFrame
Definition: mitkToFCameraMITKPlayerController.h:133
mitk::ToFCameraMITKPlayerController::m_PixelNumber
int m_PixelNumber
holds the number of pixels contained in the image
Definition: mitkToFCameraMITKPlayerController.h:98
mitk::ToFCameraMITKPlayerController::m_PixelStartInFile
long m_PixelStartInFile
Definition: mitkToFCameraMITKPlayerController.h:132
mitk::ToFCameraMITKPlayerController::m_IntensityArray
float * m_IntensityArray
member holding the current intensity frame
Definition: mitkToFCameraMITKPlayerController.h:122
mitk::ToFCameraMITKPlayerController::m_DistanceArray
float * m_DistanceArray
member holding the current distance frame
Definition: mitkToFCameraMITKPlayerController.h:123
mitk::ToFCameraMITKPlayerController::m_RGBImage
Image::Pointer m_RGBImage
Definition: mitkToFCameraMITKPlayerController.h:114