ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
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 * https://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 <cstdint>
30#endif
31
32#include "RTKExport.h"
33#include "rtkMacro.h"
34namespace rtk
35{
36
46class RTK_EXPORT HndImageIO : public itk::ImageIOBase
47{
48public:
53 using PixelType = signed short int;
54
55 using Hnd_header = struct hnd_header
56 {
57 char sFileType[32];
58 unsigned int FileLength;
59 char sChecksumSpec[4];
60 unsigned int nCheckSum;
61 char sCreationDate[8];
62 char sCreationTime[8];
63 char sPatientID[16];
64 unsigned int nPatientSer;
65 char sSeriesID[16];
66 unsigned int nSeriesSer;
67 char sSliceID[16];
68 unsigned int nSliceSer;
69 unsigned int SizeX;
70 unsigned int SizeY;
71 double dSliceZPos;
72 char sModality[16];
73 unsigned int nWindow;
74 unsigned int nLevel;
75 unsigned int nPixelOffset;
76 char sImageType[4];
77 double dGantryRtn;
78 double dSAD;
79 double dSFD;
80 double dCollX1;
81 double dCollX2;
82 double dCollY1;
83 double dCollY2;
84 double dCollRtn;
85 double dFieldX;
86 double dFieldY;
87 double dBladeX1;
88 double dBladeX2;
89 double dBladeY1;
90 double dBladeY2;
91 double dIDUPosLng;
92 double dIDUPosLat;
93 double dIDUPosVrt;
94 double dIDUPosRtn;
95 double dPatientSupportAngle;
96 double dTableTopEccentricAngle;
97 double dCouchVrt;
98 double dCouchLng;
99 double dCouchLat;
100 double dIDUResolutionX;
101 double dIDUResolutionY;
102 double dImageResolutionX;
103 double dImageResolutionY;
104 double dEnergy;
105 double dDoseRate;
106 double dXRayKV;
107 double dXRayMA;
108 double dMetersetExposure;
109 double dAcqAdjustment;
110 double dCTProjectionAngle;
111 double dCTNormChamber;
112 double dGatingTimeTag;
113 double dGating4DInfoX;
114 double dGating4DInfoY;
115 double dGating4DInfoZ;
116 double dGating4DInfoTime;
117 };
118
120
122 itkNewMacro(Self);
123
125 itkOverrideGetNameOfClassMacro(HndImageIO);
126
127 /*-------- This part of the interface deals with reading data. ------ */
128 void
130
131 bool
132 CanReadFile(const char * FileNameToRead) override;
133
134 void
135 Read(void * buffer) override;
136
137 /*-------- This part of the interfaces deals with writing data. ----- */
138 virtual void
139 WriteImageInformation(bool /*keepOfStream*/)
140 {}
141
142 void
144 {
146 }
147
148 bool
149 CanWriteFile(const char * filename) override;
150
151 void
152 Write(const void * buffer) override;
153
154}; // end class HndImageIO
155
156} // namespace rtk
157
158#endif /* end #define rtkHndImageIO_h */
Abstract superclass defines image IO interface.
Implements transparent reference counting.
bool CanWriteFile(const char *filename) override
itk::ImageIOBase Superclass
void ReadImageInformation() override
void Write(const void *buffer) override
bool CanReadFile(const char *FileNameToRead) override
virtual void WriteImageInformation(bool)
HndImageIO Self
void Read(void *buffer) override
struct hnd_header { char sFileType[32]; unsigned int FileLength; char sChecksumSpec[4]; unsigned int nCheckSum; char sCreationDate[8]; char sCreationTime[8]; char sPatientID[16]; unsigned int nPatientSer; char sSeriesID[16]; unsigned int nSeriesSer; char sSliceID[16]; unsigned int nSliceSer; unsigned int SizeX; unsigned int SizeY; double dSliceZPos; char sModality[16]; unsigned int nWindow; unsigned int nLevel; unsigned int nPixelOffset; char sImageType[4]; double dGantryRtn; double dSAD; double dSFD; double dCollX1; double dCollX2; double dCollY1; double dCollY2; double dCollRtn; double dFieldX; double dFieldY; double dBladeX1; double dBladeX2; double dBladeY1; double dBladeY2; double dIDUPosLng; double dIDUPosLat; double dIDUPosVrt; double dIDUPosRtn; double dPatientSupportAngle; double dTableTopEccentricAngle; double dCouchVrt; double dCouchLng; double dCouchLat; double dIDUResolutionX; double dIDUResolutionY; double dImageResolutionX; double dImageResolutionY; double dEnergy; double dDoseRate; double dXRayKV; double dXRayMA; double dMetersetExposure; double dAcqAdjustment; double dCTProjectionAngle; double dCTNormChamber; double dGatingTimeTag; double dGating4DInfoX; double dGating4DInfoY; double dGating4DInfoZ; double dGating4DInfoTime; } Hnd_header
signed short int PixelType
itk::SmartPointer< Self > Pointer
void WriteImageInformation() override