00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00025 #ifndef __vtkDICOMImageReader_h
00026 #define __vtkDICOMImageReader_h
00027
00028 #include "vtkImageReader2.h"
00029
00030
00031 class vtkDICOMImageReaderVector;
00032 class DICOMParser;
00033 class DICOMAppHelper;
00034
00035
00036 class VTK_IO_EXPORT vtkDICOMImageReader : public vtkImageReader2
00037 {
00038 public:
00040
00041 static vtkDICOMImageReader *New();
00042 vtkTypeRevisionMacro(vtkDICOMImageReader,vtkImageReader2);
00044
00046 void PrintSelf(ostream& os, vtkIndent indent);
00047
00049
00051 void SetFileName(const char* fn)
00052 {
00053 if (this->DirectoryName)
00054 {
00055 delete [] this->DirectoryName;
00056 }
00057 if (this->FileName)
00058 {
00059 delete [] this->FileName;
00060 }
00061 this->DirectoryName = NULL;
00062 this->FileName = NULL;
00063 this->vtkImageReader2::SetFileName(fn);
00064 }
00066
00073 void SetDirectoryName(const char* dn);
00074
00076
00077 vtkGetStringMacro(DirectoryName);
00079
00081 double* GetPixelSpacing();
00082
00084 int GetWidth();
00085
00087 int GetHeight();
00088
00092 float* GetImagePositionPatient();
00093
00095 int GetBitsAllocated();
00096
00100 int GetPixelRepresentation();
00101
00104 int GetNumberOfComponents();
00105
00107 const char* GetTransferSyntaxUID();
00108
00110 float GetRescaleSlope();
00111
00113 float GetRescaleOffset();
00114
00116 const char* GetPatientName();
00117
00119 const char* GetStudyUID();
00120
00122 const char* GetStudyID();
00123
00125 float GetGantryAngle();
00126
00127
00128
00129
00130 virtual int CanReadFile(const char* fname);
00131
00132 protected:
00133
00134
00135
00136 void SetupOutputInformation(int num_slices);
00137
00138
00139
00140
00141 virtual const char* GetFileExtensions()
00142 {
00143 return ".dcm";
00144 }
00145
00147
00149 virtual const char* GetDescriptiveName()
00150 {
00151 return "DICOM";
00152 }
00154
00155 virtual void ExecuteInformation();
00156 virtual void ExecuteData(vtkDataObject *out);
00157
00158
00159
00160
00161 vtkDICOMImageReader();
00162
00163
00164
00165
00166 virtual ~vtkDICOMImageReader();
00167
00168
00169
00170
00171 DICOMParser* Parser;
00172
00173
00174
00175
00176 DICOMAppHelper* AppHelper;
00177
00178
00179
00180
00181 vtkDICOMImageReaderVector* DICOMFileNames;
00182 char* DirectoryName;
00183
00184 char* PatientName;
00185 char* StudyUID;
00186 char* StudyID;
00187 char* TransferSyntaxUID;
00188
00189
00190 int GetNumberOfDICOMFileNames();
00191 const char* GetDICOMFileName(int index);
00192 private:
00193 vtkDICOMImageReader(const vtkDICOMImageReader&);
00194 void operator=(const vtkDICOMImageReader&);
00195
00196 };
00197
00198 #endif