Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkMRCHeaderObject_h
00019 #define __itkMRCHeaderObject_h
00020
00021
00022 #include "itkLightObject.h"
00023 #include "itkByteSwapper.h"
00024 #include "itkIntTypes.h"
00025
00026 namespace itk
00027 {
00028
00030 const char * const magicMAP = "MAP ";
00031
00032
00045 class ITK_EXPORT MRCHeaderObject :
00046 public itk::LightObject
00047 {
00048 public:
00050 typedef MRCHeaderObject Self;
00051 typedef LightObject Superclass;
00052 typedef SmartPointer<Self> Pointer;
00053 typedef SmartPointer<const Self> ConstPointer;
00054
00055
00063 struct Header
00064 {
00065
00081 int32_t mode;
00082
00084 int32_t nxstart;
00085 int32_t nystart;
00086 int32_t nzstart;
00087
00088
00090 int32_t mx;
00091 int32_t my;
00092 int32_t mz;
00093
00095 float xlen;
00096 float ylen;
00097 float zlen;
00098
00099
00101 float alpha;
00102 float beta;
00103 float gamma;
00104
00105
00113
00114
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140 int16_t nint;
00141
00142 int16_t nreal;
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00157 int8_t notused2[28];
00158
00159
00160 int16_t idtype;
00161 int16_t lens;
00162 int16_t nd1;
00163 int16_t nd2;
00164 int16_t vd1;
00165 int16_t vd2;
00166
00167
00168 float tiltangles[6];
00169
00170
00171
00172 float xorg;
00173 float yorg;
00174 float zorg;
00175
00176
00180 float rms;
00181
00182
00186 };
00187
00189 struct FeiExtendedHeader
00190 {
00191
00215 float magnification;
00216
00218 };
00219
00221 enum {MRCHEADER_MODE_UINT8 = 0,
00222 MRCHEADER_MODE_IN16 = 1,
00223 MRCHEADER_MODE_FLOAT = 2,
00224 MRCHEADER_MODE_COMPLEX_INT16 = 3,
00225 MRCHEADER_MODE_COMPLEX_FLOAT = 4,
00226 MRCHEADER_MODE_UINT16 = 6,
00227 MRCHEADER_MODE_RGB_BYTE = 16};
00228
00230 enum {MRCHEADER_MAP_X = 1,
00231 MRCHEADER_MAP_Y = 2,
00232 MRCHEADER_MAP_Z = 3};
00233
00234 public:
00235
00236
00238 itkNewMacro(Self);
00239
00240
00242 itkTypeMacro(MRCHeaderObject, LightObject);
00243
00244
00245 void DeepCopy(ConstPointer h);
00246
00257 bool SetHeader(const Header *buffer);
00258 const Header & GetHeader() const;
00260
00269 bool SetExtendedHeader(const void *buffer);
00270
00271
00275 size_t GetExtendedHeaderSize(void) const;
00276
00278 size_t GetHeaderSize(void) const { return sizeof(Header); }
00279
00283 bool IsOriginalHeaderBigEndian(void) const;
00284
00286 Header m_Header;
00287
00288 protected:
00289
00290 MRCHeaderObject(void);
00291 ~MRCHeaderObject(void);
00292
00294 void swapHeader(bool bigEndian);
00295
00297 void PrintSelf(std::ostream& os, Indent indent) const;
00298
00299 private:
00300 MRCHeaderObject(const Self&);
00301 void operator=(const Self&);
00302
00303 size_t m_ExtendedHeaderSize;
00304 void * m_ExtendedHeader;
00305
00306 FeiExtendedHeader * m_ExtendedFeiHeader;
00307
00308 bool m_BigEndianHeader;
00309
00310 };
00311
00312 }
00313
00314 #endif
00315