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