Medical Imaging Interaction Toolkit  2016.11.0
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,
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 __mitkToFImageWriter_h
17 #define __mitkToFImageWriter_h
18 
19 #include <MitkToFHardwareExports.h>
20 #include "mitkCommon.h"
21 #include "mitkToFImageGrabber.h"
22 
23 #include "itkObject.h"
24 #include "itkObjectFactory.h"
25 
26 namespace mitk
27 {
38  class MITKTOFHARDWARE_EXPORT ToFImageWriter : public itk::Object
39  {
40  public:
41 
43 
44  ~ToFImageWriter();
45 
46  mitkClassMacroItkParent( ToFImageWriter , itk::Object );
47 
48  itkFactorylessNewMacro(Self)
49  itkCloneMacro(Self)
50 
51  itkGetMacro( DistanceImageFileName, std::string );
52  itkGetMacro( AmplitudeImageFileName, std::string );
53  itkGetMacro( IntensityImageFileName, std::string );
54  itkGetMacro( RGBImageFileName, std::string );
55  itkGetMacro( Extension, std::string );
56  itkGetMacro( ToFCaptureWidth, int );
57  itkGetMacro( ToFCaptureHeight, int );
58  itkGetMacro( RGBCaptureWidth, int );
59  itkGetMacro( RGBCaptureHeight, int );
60  itkGetMacro( DistanceImageSelected, bool );
61  itkGetMacro( AmplitudeImageSelected, bool );
62  itkGetMacro( IntensityImageSelected, bool );
63  itkGetMacro( RGBImageSelected, bool );
64 
65  itkSetMacro( DistanceImageFileName, std::string );
66  itkSetMacro( AmplitudeImageFileName, std::string );
67  itkSetMacro( IntensityImageFileName, std::string );
68  itkSetMacro( RGBImageFileName, std::string );
69  itkSetMacro( Extension, std::string );
70  itkSetMacro( ToFCaptureWidth, int );
71  itkSetMacro( ToFCaptureHeight, int );
72  itkSetMacro( RGBCaptureWidth, int );
73  itkSetMacro( RGBCaptureHeight, int );
74  itkSetMacro( DistanceImageSelected, bool );
75  itkSetMacro( AmplitudeImageSelected, bool );
76  itkSetMacro( IntensityImageSelected, bool );
77  itkSetMacro( RGBImageSelected, bool );
78 
79  enum ToFImageType{ ToFImageType3D, ToFImageType2DPlusT };
84  ToFImageWriter::ToFImageType GetToFImageType();
89  void SetToFImageType(ToFImageWriter::ToFImageType toFImageType);
93  virtual void Open(){};
97  virtual void Close(){};
101  virtual void Add(float* distanceFloatData, float* amplitudeFloatData, float* intensityFloatData, unsigned char* rgbData=0){};
102 
103  protected:
104 
108  void CheckForFileExtension(std::string& fileName);
109 
110  // member variables
114  std::string m_RGBImageFileName;
115  std::string m_Extension;
116 
127 
132 
133  private:
134 
135  };
136 } //END mitk namespace
137 #endif // __mitkToFImageWriter_h
int m_RGBImageSizeInBytes
size of the image to save in bytes
bool m_AmplitudeImageSelected
flag indicating if amplitude image should be recorded
int m_NumOfFrames
number of frames written to the image. Used for pic header.
bool m_IntensityImageSelected
flag indicating if intensity image should be recorded
bool m_DistanceImageSelected
flag indicating if distance image should be recorded
DataCollection - Class to facilitate loading/accessing structured data.
virtual void Close()
Close file(s) add .pic header and write.
int m_RGBPixelNumber
number of pixels (widht*height) of the images to record
int m_ToFCaptureWidth
width (x-dimension) of the images to record.
int m_ToFCaptureHeight
height (y-dimension) of the images to record.
int m_RGBCaptureHeight
height (y-dimension) of the images to record.
std::string m_IntensityImageFileName
file name for saving the intensity image
bool m_RGBImageSelected
flag indicating if RGB image should be recorded
std::string m_AmplitudeImageFileName
file name for saving the amplitude image
int m_ToFPixelNumber
number of pixels (widht*height) of the images to record
std::string m_Extension
file extension used for saving images
Writer class for ToF images.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
std::string m_DistanceImageFileName
file name for saving the distance image
int m_ToFImageSizeInBytes
size of the image to save in bytes
std::string m_RGBImageFileName
file name for saving the RGB image
virtual void Open()
Open file(s) for writing.
ToFImageWriter::ToFImageType m_ToFImageType
type of image to be recorded: ToFImageType3D (0) or ToFImageType2DPlusT (1)
virtual void Add(float *distanceFloatData, float *amplitudeFloatData, float *intensityFloatData, unsigned char *rgbData=0)
Add new data to file.
int m_RGBCaptureWidth
width (x-dimension) of the images to record.