00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __mitkMetaImageReader_h
00012 #define __mitkMetaImageReader_h
00013
00014 #include "mitkVolumeReader.h"
00015
00016 namespace metaio { class MetaImage; }
00017
00022 class MITK_COMMON_API mitkMetaImageReader : public mitkVolumeReader
00023 {
00024 public:
00025 MITK_TYPE(mitkMetaImageReader, mitkVolumeReader)
00026
00027 virtual void PrintSelf(ostream &os);
00028
00029 mitkMetaImageReader();
00030
00031 const char * GetFileExtensions() { return ".mhd .mha"; }
00032
00033 const char * GetDescriptiveName() { return "MetaIO Library: MetaImage"; }
00034
00035 void SetFileDimensionality(int d) { FileDimensionality = d; }
00036 int GetFileDimensionality() { return FileDimensionality; }
00037
00038 void SetNumberOfScalarComponents(int n) { NumberOfScalarComponents = n; }
00039 int GetNumberOfScalarComponents() { return NumberOfScalarComponents; }
00040
00041 void SetDataExtent(int d[6]) { for(int i=0;i<6;i++) DataExtent[i] = d[i]; }
00042 int* GetDataExtent() { return DataExtent; }
00043
00044 void SetDataSpacing(double s[3]) { for(int i=0;i<3;i++) DataSpacing[i] = s[i]; }
00045 double* GetDataSpacing() { return DataSpacing; }
00046
00047 void SetDataOrigin(double o[3]) { for(int i=0;i<3;i++) DataOrigin[i] = o[i]; }
00048 double* GetDataOrigin() { return DataOrigin; }
00049
00050 void SetHeaderSize(unsigned long size) { HeaderSize = size; }
00051 unsigned long GetHeaderSize() { return HeaderSize; }
00052
00053 unsigned long long GetDataBytes();
00054
00055 protected:
00056 virtual ~mitkMetaImageReader();
00057
00058 virtual bool Execute();
00059 bool ReadInfo();
00060 bool ReadData();
00061
00062 private:
00063 mitkMetaImageReader(const mitkMetaImageReader&);
00064 void operator = (const mitkMetaImageReader&);
00065
00066 int FileDimensionality;
00067 int DataScalarType;
00068 int NumberOfScalarComponents;
00069 int DataExtent[6];
00070 double DataSpacing[3];
00071 double DataOrigin[3];
00072 unsigned long HeaderSize;
00073 int FileLowerLeft;
00074
00075 metaio::MetaImage *MetaImagePtr;
00076
00077 public:
00078 double GantryAngle;
00079 char PatientName[255];
00080 char PatientID[255];
00081 char Date[255];
00082 char Series[255];
00083 char Study[255];
00084 char ImageNumber[255];
00085 char Modality[255];
00086 char StudyID[255];
00087 char StudyUID[255];
00088 char TransferSyntaxUID[255];
00089
00090 double RescaleSlope;
00091 double RescaleOffset;
00092 int BitsAllocated;
00093 char DistanceUnits[255];
00094 char AnatomicalOrientation[255];
00095
00096 };
00097
00098
00099
00100
00101
00102
00103 #endif
00104