00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00062 #ifndef __vtkMetaImageReader2_h
00063 #define __vtkMetaImageReader2_h
00064
00065 #include "vtkImageReader2.h"
00066
00067
00068 namespace vtkmetaio { class MetaImage; }
00069
00070
00071 class VTK_IO_EXPORT vtkMetaImageReader : public vtkImageReader2
00072 {
00073 public:
00074 vtkTypeRevisionMacro(vtkMetaImageReader,vtkImageReader2);
00075 void PrintSelf(ostream& os, vtkIndent indent);
00076
00078 static vtkMetaImageReader *New();
00079
00080 virtual const char * GetFileExtensions()
00081 { return ".mhd .mha"; }
00082
00083 virtual const char * GetDescriptiveName()
00084 { return "MetaIO Library: MetaImage"; }
00085
00086
00087 double * GetPixelSpacing()
00088 { return this->GetDataSpacing(); }
00089 int GetWidth()
00090 { return (this->GetDataExtent()[1] - this->GetDataExtent()[0] + 1); }
00091 int GetHeight()
00092 { return (this->GetDataExtent()[3] - this->GetDataExtent()[2] + 1); }
00093 double * GetImagePositionPatient()
00094 { return this->GetDataOrigin(); }
00095 int GetNumberOfComponents()
00096 { return this->GetNumberOfScalarComponents(); }
00097 int GetPixelRepresentation()
00098 { return this->GetDataScalarType(); }
00099 int GetDataByteOrder(void);
00100
00101 vtkGetMacro(RescaleSlope, double);
00102 vtkGetMacro(RescaleOffset, double);
00103 vtkGetMacro(BitsAllocated, int);
00104 vtkGetStringMacro(DistanceUnits);
00105 vtkGetStringMacro(AnatomicalOrientation);
00106 vtkGetMacro(GantryAngle, double);
00107 vtkGetStringMacro(PatientName);
00108 vtkGetStringMacro(PatientID);
00109 vtkGetStringMacro(Date);
00110 vtkGetStringMacro(Series);
00111 vtkGetStringMacro(ImageNumber);
00112 vtkGetStringMacro(Modality);
00113 vtkGetStringMacro(StudyID);
00114 vtkGetStringMacro(StudyUID);
00115 vtkGetStringMacro(TransferSyntaxUID);
00116
00118 virtual int CanReadFile(const char* name);
00119
00120 protected:
00121 vtkMetaImageReader();
00122 ~vtkMetaImageReader();
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174 void ExecuteInformation();
00175 void ExecuteData(vtkDataObject *out);
00176 virtual int RequestInformation(vtkInformation * request,
00177 vtkInformationVector ** inputVector,
00178 vtkInformationVector * outputVector);
00179
00180 private:
00181 vtkMetaImageReader(const vtkMetaImageReader&);
00182 void operator=(const vtkMetaImageReader&);
00183
00184
00185 vtkmetaio::MetaImage *MetaImagePtr;
00186
00187
00188 double GantryAngle;
00189 char PatientName[255];
00190 char PatientID[255];
00191 char Date[255];
00192 char Series[255];
00193 char Study[255];
00194 char ImageNumber[255];
00195 char Modality[255];
00196 char StudyID[255];
00197 char StudyUID[255];
00198 char TransferSyntaxUID[255];
00199
00200 double RescaleSlope;
00201 double RescaleOffset;
00202 int BitsAllocated;
00203 char DistanceUnits[255];
00204 char AnatomicalOrientation[255];
00205 };
00206
00207 #endif
00208
00209
00210