Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitkToFImageWriter.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 mitkToFImageWriter_h
13 #define mitkToFImageWriter_h
14 
15 #include <MitkToFHardwareExports.h>
16 #include "mitkCommon.h"
17 #include "mitkToFImageGrabber.h"
18 
19 #include "itkObject.h"
20 #include "itkObjectFactory.h"
21 
22 namespace mitk
23 {
34  class MITKTOFHARDWARE_EXPORT ToFImageWriter : public itk::Object
35  {
36  public:
37 
39 
40  ~ToFImageWriter() override;
41 
42  mitkClassMacroItkParent( ToFImageWriter , itk::Object );
43 
44  itkFactorylessNewMacro(Self);
45 
46  itkCloneMacro(Self);
47 
48  itkGetMacro( DistanceImageFileName, std::string );
49  itkGetMacro( AmplitudeImageFileName, std::string );
50  itkGetMacro( IntensityImageFileName, std::string );
51  itkGetMacro( RGBImageFileName, std::string );
52  itkGetMacro( Extension, std::string );
53  itkGetMacro( ToFCaptureWidth, int );
54  itkGetMacro( ToFCaptureHeight, int );
55  itkGetMacro( RGBCaptureWidth, int );
56  itkGetMacro( RGBCaptureHeight, int );
57  itkGetMacro( DistanceImageSelected, bool );
58  itkGetMacro( AmplitudeImageSelected, bool );
59  itkGetMacro( IntensityImageSelected, bool );
60  itkGetMacro( RGBImageSelected, bool );
61 
62  itkSetMacro( DistanceImageFileName, std::string );
63  itkSetMacro( AmplitudeImageFileName, std::string );
64  itkSetMacro( IntensityImageFileName, std::string );
65  itkSetMacro( RGBImageFileName, std::string );
66  itkSetMacro( Extension, std::string );
67  itkSetMacro( ToFCaptureWidth, int );
68  itkSetMacro( ToFCaptureHeight, int );
69  itkSetMacro( RGBCaptureWidth, int );
70  itkSetMacro( RGBCaptureHeight, int );
71  itkSetMacro( DistanceImageSelected, bool );
72  itkSetMacro( AmplitudeImageSelected, bool );
73  itkSetMacro( IntensityImageSelected, bool );
74  itkSetMacro( RGBImageSelected, bool );
75 
76  enum ToFImageType{ ToFImageType3D, ToFImageType2DPlusT };
81  ToFImageWriter::ToFImageType GetToFImageType();
86  void SetToFImageType(ToFImageWriter::ToFImageType toFImageType);
90  virtual void Open(){};
94  virtual void Close(){};
98  virtual void Add(float* /*distanceFloatData*/, float* /*amplitudeFloatData*/, float* /*intensityFloatData*/, unsigned char* /*rgbData*/=nullptr){};
99 
100  protected:
101 
105  void CheckForFileExtension(std::string& fileName);
106 
107  // member variables
108  std::string m_Extension;
112  std::string m_RGBImageFileName;
113 
128  };
129 } //END mitk namespace
130 #endif
mitk::ToFImageWriter::Add
virtual void Add(float *, float *, float *, unsigned char *=nullptr)
Add new data to file.
Definition: mitkToFImageWriter.h:98
mitk::ToFImageWriter::m_DistanceImageFileName
std::string m_DistanceImageFileName
file name for saving the distance image
Definition: mitkToFImageWriter.h:109
mitk::ToFImageWriter::ToFImageType
ToFImageType
Definition: mitkToFImageWriter.h:76
mitk::ToFImageWriter::m_Extension
std::string m_Extension
file extension used for saving images
Definition: mitkToFImageWriter.h:108
mitk::ToFImageWriter
Writer class for ToF images.
Definition: mitkToFImageWriter.h:34
mitk::ToFImageWriter::m_ToFImageType
ToFImageWriter::ToFImageType m_ToFImageType
type of image to be recorded: ToFImageType3D (0) or ToFImageType2DPlusT (1)
Definition: mitkToFImageWriter.h:127
mitk::ToFImageWriter::Open
virtual void Open()
Open file(s) for writing.
Definition: mitkToFImageWriter.h:90
mitk::ToFImageWriter::m_RGBImageFileName
std::string m_RGBImageFileName
file name for saving the RGB image
Definition: mitkToFImageWriter.h:112
mitk::ToFImageWriter::m_RGBCaptureWidth
int m_RGBCaptureWidth
width (x-dimension) of the images to record.
Definition: mitkToFImageWriter.h:121
mitk::ToFImageWriter::m_ToFImageSizeInBytes
int m_ToFImageSizeInBytes
size of the image to save in bytes
Definition: mitkToFImageWriter.h:124
mitkClassMacroItkParent
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::ToFImageWriter::m_RGBImageSizeInBytes
int m_RGBImageSizeInBytes
size of the image to save in bytes
Definition: mitkToFImageWriter.h:126
mitk::ToFImageWriter::m_NumOfFrames
int m_NumOfFrames
number of frames written to the image. Used for pic header.
Definition: mitkToFImageWriter.h:114
mitk::ToFImageWriter::ToFImageType3D
@ ToFImageType3D
Definition: mitkToFImageWriter.h:76
mitkCommon.h
mitk::ToFImageWriter::m_AmplitudeImageSelected
bool m_AmplitudeImageSelected
flag indicating if amplitude image should be recorded
Definition: mitkToFImageWriter.h:116
mitk::ToFImageWriter::m_DistanceImageSelected
bool m_DistanceImageSelected
flag indicating if distance image should be recorded
Definition: mitkToFImageWriter.h:115
mitk::ToFImageWriter::m_IntensityImageSelected
bool m_IntensityImageSelected
flag indicating if intensity image should be recorded
Definition: mitkToFImageWriter.h:117
mitk::ToFImageWriter::Close
virtual void Close()
Close file(s) add header and write.
Definition: mitkToFImageWriter.h:94
mitk::ToFImageWriter::m_RGBPixelNumber
int m_RGBPixelNumber
number of pixels (widht*height) of the images to record
Definition: mitkToFImageWriter.h:125
mitk::ToFImageWriter::m_ToFCaptureHeight
int m_ToFCaptureHeight
height (y-dimension) of the images to record.
Definition: mitkToFImageWriter.h:120
mitkToFImageGrabber.h
mitk::ToFImageWriter::m_RGBImageSelected
bool m_RGBImageSelected
flag indicating if RGB image should be recorded
Definition: mitkToFImageWriter.h:118
mitk::ToFImageWriter::m_IntensityImageFileName
std::string m_IntensityImageFileName
file name for saving the intensity image
Definition: mitkToFImageWriter.h:111
mitk::ToFImageWriter::m_ToFCaptureWidth
int m_ToFCaptureWidth
width (x-dimension) of the images to record.
Definition: mitkToFImageWriter.h:119
mitk::ToFImageWriter::m_ToFPixelNumber
int m_ToFPixelNumber
number of pixels (widht*height) of the images to record
Definition: mitkToFImageWriter.h:123
mitk::ToFImageWriter::m_RGBCaptureHeight
int m_RGBCaptureHeight
height (y-dimension) of the images to record.
Definition: mitkToFImageWriter.h:122
mitk::ToFImageWriter::m_AmplitudeImageFileName
std::string m_AmplitudeImageFileName
file name for saving the amplitude image
Definition: mitkToFImageWriter.h:110