1 /*=========================================================================
2 Program: vv http://www.creatis.insa-lyon.fr/rio/vv
5 - University of LYON http://www.universite-lyon.fr/
6 - Léon Bérard cancer center http://www.centreleonberard.fr
7 - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the copyright notices for more information.
13 It is distributed under dual licence
15 - BSD See included LICENSE.txt file
16 - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef CLITKHNDIMAGEIO_H
19 #define CLITKHNDIMAGEIO_H
22 #include "itkImageIOBase.h"
24 #if defined (_MSC_VER) && (_MSC_VER < 1600)
26 //#include "msinttypes/stdint.h"
27 typedef unsigned int uint32_t;
34 //====================================================================
35 // Class for reading Hnd Image file format
36 class HndImageIO: public itk::ImageIOBase
39 /** Standard class typedefs. */
40 typedef HndImageIO Self;
41 typedef itk::ImageIOBase Superclass;
42 typedef itk::SmartPointer<Self> Pointer;
43 typedef signed short int PixelType;
45 typedef struct hnd_header {
48 char sChecksumSpec[4];
50 char sCreationDate[8];
51 char sCreationTime[8];
64 uint32_t nPixelOffset;
84 double dPatientSupportAngle;
85 double dTableTopEccentricAngle;
89 double dIDUResolutionX;
90 double dIDUResolutionY;
91 double dImageResolutionX;
92 double dImageResolutionY;
97 double dMetersetExposure;
98 double dAcqAdjustment;
99 double dCTProjectionAngle;
100 double dCTNormChamber;
101 double dGatingTimeTag;
102 double dGating4DInfoX;
103 double dGating4DInfoY;
104 double dGating4DInfoZ;
105 double dGating4DInfoTime;
108 HndImageIO():Superclass() {;}
110 /** Method for creation through the object factory. */
113 /** Run-time type information (and related methods). */
114 itkTypeMacro(HndImageIO, ImageIOBase);
116 /*-------- This part of the interface deals with reading data. ------ */
117 virtual void ReadImageInformation();
118 virtual bool CanReadFile( const char* FileNameToRead );
119 virtual void Read(void * buffer);
121 /*-------- This part of the interfaces deals with writing data. ----- */
122 virtual void WriteImageInformation(bool keepOfStream) { ; }
123 virtual void WriteImageInformation() { WriteImageInformation(false); }
124 virtual bool CanWriteFile(const char* filename);
125 virtual void Write(const void* buffer);
130 }; // end class HndImageIO
133 // explicit template instantiation
134 //template class itk::CreateObjectFunction<clitk::HndImageIO>;
136 #endif /* end #define CLITKHNDIMAGEIO_H */