RTK  1.4.0
Reconstruction Toolkit
rtkHndImageIO.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright RTK Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef rtkHndImageIO_h
20 #define rtkHndImageIO_h
21 
22 // itk include
23 #include <itkImageIOBase.h>
24 
25 #if defined (_MSC_VER) && (_MSC_VER < 1600)
26 //SR: taken from
27 //#include "msinttypes/stdint.h"
28 #else
29 #include <stdint.h>
30 #endif
31 
32 #include "rtkMacro.h"
33 
34 namespace rtk {
35 
46 {
47 public:
49  typedef HndImageIO Self;
52  typedef signed short int PixelType;
53 
54  typedef struct hnd_header {
55  char sFileType[32];
56  unsigned int FileLength;
57  char sChecksumSpec[4];
58  unsigned int nCheckSum;
59  char sCreationDate[8];
60  char sCreationTime[8];
61  char sPatientID[16];
62  unsigned int nPatientSer;
63  char sSeriesID[16];
64  unsigned int nSeriesSer;
65  char sSliceID[16];
66  unsigned int nSliceSer;
67  unsigned int SizeX;
68  unsigned int SizeY;
69  double dSliceZPos;
70  char sModality[16];
71  unsigned int nWindow;
72  unsigned int nLevel;
73  unsigned int nPixelOffset;
74  char sImageType[4];
75  double dGantryRtn;
76  double dSAD;
77  double dSFD;
78  double dCollX1;
79  double dCollX2;
80  double dCollY1;
81  double dCollY2;
82  double dCollRtn;
83  double dFieldX;
84  double dFieldY;
85  double dBladeX1;
86  double dBladeX2;
87  double dBladeY1;
88  double dBladeY2;
89  double dIDUPosLng;
90  double dIDUPosLat;
91  double dIDUPosVrt;
92  double dIDUPosRtn;
95  double dCouchVrt;
96  double dCouchLng;
97  double dCouchLat;
102  double dEnergy;
103  double dDoseRate;
104  double dXRayKV;
105  double dXRayMA;
115  } Hnd_header;
116 
117  HndImageIO() : Superclass() {}
118 
120  itkNewMacro(Self);
121 
123  itkTypeMacro(HndImageIO, itk::ImageIOBase);
124 
125  /*-------- This part of the interface deals with reading data. ------ */
126  void ReadImageInformation() ITK_OVERRIDE;
127 
128  bool CanReadFile( const char* FileNameToRead ) ITK_OVERRIDE;
129 
130  void Read(void * buffer) ITK_OVERRIDE;
131 
132  /*-------- This part of the interfaces deals with writing data. ----- */
133  virtual void WriteImageInformation(bool /*keepOfStream*/) { }
134 
135  void WriteImageInformation() ITK_OVERRIDE { WriteImageInformation(false); }
136 
137  bool CanWriteFile(const char* filename) ITK_OVERRIDE;
138 
139  void Write(const void* buffer) ITK_OVERRIDE;
140 
141 }; // end class HndImageIO
142 
143 } // end namespace
144 
145 #endif /* end #define rtkHndImageIO_h */
virtual void WriteImageInformation(bool)
itk::ImageIOBase Superclass
Definition: rtkHndImageIO.h:50
HndImageIO Self
Definition: rtkHndImageIO.h:49
bool CanWriteFile(const char *filename) override
void Read(void *buffer) override
Class for reading Hnd Image file format.
Definition: rtkHndImageIO.h:45
void WriteImageInformation() override
signed short int PixelType
Definition: rtkHndImageIO.h:52
itk::SmartPointer< Self > Pointer
Definition: rtkHndImageIO.h:51
void ReadImageInformation() override
void Write(const void *buffer) override
struct rtk::HndImageIO::hnd_header Hnd_header
bool CanReadFile(const char *FileNameToRead) override