00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00033 #ifndef __vtkDICOMImageReader_h
00034 #define __vtkDICOMImageReader_h
00035
00036 #include "vtkImageReader2.h"
00037
00038
00039 class vtkDICOMImageReaderVector;
00040 class DICOMParser;
00041 class DICOMAppHelper;
00042
00043
00044 class VTK_IO_EXPORT vtkDICOMImageReader : public vtkImageReader2
00045 {
00046 public:
00048
00049 static vtkDICOMImageReader *New();
00050 vtkTypeRevisionMacro(vtkDICOMImageReader,vtkImageReader2);
00052
00054 void PrintSelf(ostream& os, vtkIndent indent);
00055
00057
00059 void SetFileName(const char* fn)
00060 {
00061 if (this->DirectoryName)
00062 {
00063 delete [] this->DirectoryName;
00064 }
00065 if (this->FileName)
00066 {
00067 delete [] this->FileName;
00068 }
00069 this->DirectoryName = NULL;
00070 this->FileName = NULL;
00071 this->vtkImageReader2::SetFileName(fn);
00072 }
00074
00081 void SetDirectoryName(const char* dn);
00082
00084
00085 vtkGetStringMacro(DirectoryName);
00087
00089 double* GetPixelSpacing();
00090
00092 int GetWidth();
00093
00095 int GetHeight();
00096
00100 float* GetImagePositionPatient();
00101
00105 float* GetImageOrientationPatient();
00106
00108 int GetBitsAllocated();
00109
00113 int GetPixelRepresentation();
00114
00117 int GetNumberOfComponents();
00118
00120 const char* GetTransferSyntaxUID();
00121
00123 float GetRescaleSlope();
00124
00126 float GetRescaleOffset();
00127
00129 const char* GetPatientName();
00130
00132 const char* GetStudyUID();
00133
00135 const char* GetStudyID();
00136
00138 float GetGantryAngle();
00139
00140
00141
00142
00143 virtual int CanReadFile(const char* fname);
00144
00145
00146
00147
00148 virtual const char* GetFileExtensions()
00149 {
00150 return ".dcm";
00151 }
00152
00154
00156 virtual const char* GetDescriptiveName()
00157 {
00158 return "DICOM";
00159 }
00161
00162 protected:
00163
00164
00165
00166 void SetupOutputInformation(int num_slices);
00167
00168 virtual void ExecuteInformation();
00169 virtual void ExecuteData(vtkDataObject *out);
00170
00171
00172
00173
00174 vtkDICOMImageReader();
00175
00176
00177
00178
00179 virtual ~vtkDICOMImageReader();
00180
00181
00182
00183
00184 DICOMParser* Parser;
00185
00186
00187
00188
00189 DICOMAppHelper* AppHelper;
00190
00191
00192
00193
00194 vtkDICOMImageReaderVector* DICOMFileNames;
00195 char* DirectoryName;
00196
00197 char* PatientName;
00198 char* StudyUID;
00199 char* StudyID;
00200 char* TransferSyntaxUID;
00201
00202
00203 int GetNumberOfDICOMFileNames();
00204 const char* GetDICOMFileName(int index);
00205 private:
00206 vtkDICOMImageReader(const vtkDICOMImageReader&);
00207 void operator=(const vtkDICOMImageReader&);
00208
00209 };
00210
00211 #endif