00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00042 #ifndef __vtkDICOMImageReader_h
00043 #define __vtkDICOMImageReader_h
00044
00045 #include "vtkImageReader2.h"
00046
00047
00048 class vtkDICOMImageReaderVector;
00049 class DICOMParser;
00050 class DICOMAppHelper;
00051
00052
00053 class VTK_IO_EXPORT vtkDICOMImageReader : public vtkImageReader2
00054 {
00055 public:
00057
00058 static vtkDICOMImageReader *New();
00059 vtkTypeMacro(vtkDICOMImageReader,vtkImageReader2);
00061
00063 void PrintSelf(ostream& os, vtkIndent indent);
00064
00066
00068 void SetFileName(const char* fn)
00069 {
00070 if (this->DirectoryName)
00071 {
00072 delete [] this->DirectoryName;
00073 }
00074 if (this->FileName)
00075 {
00076 delete [] this->FileName;
00077 }
00078 this->DirectoryName = NULL;
00079 this->FileName = NULL;
00080 this->vtkImageReader2::SetFileName(fn);
00081 }
00083
00090 void SetDirectoryName(const char* dn);
00091
00093
00094 vtkGetStringMacro(DirectoryName);
00096
00101 double* GetPixelSpacing();
00102
00104 int GetWidth();
00105
00107 int GetHeight();
00108
00112 float* GetImagePositionPatient();
00113
00117 float* GetImageOrientationPatient();
00118
00120 int GetBitsAllocated();
00121
00125 int GetPixelRepresentation();
00126
00129 int GetNumberOfComponents();
00130
00132 const char* GetTransferSyntaxUID();
00133
00135 float GetRescaleSlope();
00136
00138 float GetRescaleOffset();
00139
00141 const char* GetPatientName();
00142
00144 const char* GetStudyUID();
00145
00147 const char* GetStudyID();
00148
00150 float GetGantryAngle();
00151
00152
00153
00154
00155 virtual int CanReadFile(const char* fname);
00156
00157
00158
00159
00160 virtual const char* GetFileExtensions()
00161 {
00162 return ".dcm";
00163 }
00164
00166
00168 virtual const char* GetDescriptiveName()
00169 {
00170 return "DICOM";
00171 }
00173
00174 protected:
00175
00176
00177
00178 void SetupOutputInformation(int num_slices);
00179
00180 virtual void ExecuteInformation();
00181 virtual void ExecuteData(vtkDataObject *out);
00182
00183
00184
00185
00186 vtkDICOMImageReader();
00187
00188
00189
00190
00191 virtual ~vtkDICOMImageReader();
00192
00193
00194
00195
00196 DICOMParser* Parser;
00197
00198
00199
00200
00201 DICOMAppHelper* AppHelper;
00202
00203
00204
00205
00206 vtkDICOMImageReaderVector* DICOMFileNames;
00207 char* DirectoryName;
00208
00209 char* PatientName;
00210 char* StudyUID;
00211 char* StudyID;
00212 char* TransferSyntaxUID;
00213
00214
00215 int GetNumberOfDICOMFileNames();
00216 const char* GetDICOMFileName(int index);
00217 private:
00218 vtkDICOMImageReader(const vtkDICOMImageReader&);
00219 void operator=(const vtkDICOMImageReader&);
00220
00221 };
00222
00223 #endif