00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00065 #ifndef __vtkMetaImageReader2_h
00066 #define __vtkMetaImageReader2_h
00067
00068 #include "vtkImageReader2.h"
00069
00070
00071 namespace vtkmetaio { class MetaImage; }
00072
00073
00074 class VTK_IO_EXPORT vtkMetaImageReader : public vtkImageReader2
00075 {
00076 public:
00077 vtkTypeMacro(vtkMetaImageReader,vtkImageReader2);
00078 void PrintSelf(ostream& os, vtkIndent indent);
00079
00081 static vtkMetaImageReader *New();
00082
00083 virtual const char * GetFileExtensions()
00084 { return ".mhd .mha"; }
00085
00086 virtual const char * GetDescriptiveName()
00087 { return "MetaIO Library: MetaImage"; }
00088
00089
00090 double * GetPixelSpacing()
00091 { return this->GetDataSpacing(); }
00092 int GetWidth()
00093 { return (this->GetDataExtent()[1] - this->GetDataExtent()[0] + 1); }
00094 int GetHeight()
00095 { return (this->GetDataExtent()[3] - this->GetDataExtent()[2] + 1); }
00096 double * GetImagePositionPatient()
00097 { return this->GetDataOrigin(); }
00098 int GetNumberOfComponents()
00099 { return this->GetNumberOfScalarComponents(); }
00100 int GetPixelRepresentation()
00101 { return this->GetDataScalarType(); }
00102 int GetDataByteOrder(void);
00103
00104 vtkGetMacro(RescaleSlope, double);
00105 vtkGetMacro(RescaleOffset, double);
00106 vtkGetMacro(BitsAllocated, int);
00107 vtkGetStringMacro(DistanceUnits);
00108 vtkGetStringMacro(AnatomicalOrientation);
00109 vtkGetMacro(GantryAngle, double);
00110 vtkGetStringMacro(PatientName);
00111 vtkGetStringMacro(PatientID);
00112 vtkGetStringMacro(Date);
00113 vtkGetStringMacro(Series);
00114 vtkGetStringMacro(ImageNumber);
00115 vtkGetStringMacro(Modality);
00116 vtkGetStringMacro(StudyID);
00117 vtkGetStringMacro(StudyUID);
00118 vtkGetStringMacro(TransferSyntaxUID);
00119
00121 virtual int CanReadFile(const char* name);
00122
00123 protected:
00124 vtkMetaImageReader();
00125 ~vtkMetaImageReader();
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
00175
00176
00177 void ExecuteInformation();
00178 void ExecuteData(vtkDataObject *out);
00179 virtual int RequestInformation(vtkInformation * request,
00180 vtkInformationVector ** inputVector,
00181 vtkInformationVector * outputVector);
00182
00183 private:
00184 vtkMetaImageReader(const vtkMetaImageReader&);
00185 void operator=(const vtkMetaImageReader&);
00186
00187
00188 vtkmetaio::MetaImage *MetaImagePtr;
00189
00190
00191 double GantryAngle;
00192 char PatientName[255];
00193 char PatientID[255];
00194 char Date[255];
00195 char Series[255];
00196 char Study[255];
00197 char ImageNumber[255];
00198 char Modality[255];
00199 char StudyID[255];
00200 char StudyUID[255];
00201 char TransferSyntaxUID[255];
00202
00203 double RescaleSlope;
00204 double RescaleOffset;
00205 int BitsAllocated;
00206 char DistanceUnits[255];
00207 char AnatomicalOrientation[255];
00208 };
00209
00210 #endif
00211
00212
00213