VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkDICOMImageReader.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00039 #ifndef __vtkDICOMImageReader_h 00040 #define __vtkDICOMImageReader_h 00041 00042 #include "vtkImageReader2.h" 00043 00044 //BTX 00045 class vtkDICOMImageReaderVector; 00046 class DICOMParser; 00047 class DICOMAppHelper; 00048 //ETX 00049 00050 class VTK_IO_EXPORT vtkDICOMImageReader : public vtkImageReader2 00051 { 00052 public: 00054 00055 static vtkDICOMImageReader *New(); 00056 vtkTypeRevisionMacro(vtkDICOMImageReader,vtkImageReader2); 00058 00060 void PrintSelf(ostream& os, vtkIndent indent); 00061 00063 00065 void SetFileName(const char* fn) 00066 { 00067 if (this->DirectoryName) 00068 { 00069 delete [] this->DirectoryName; 00070 } 00071 if (this->FileName) 00072 { 00073 delete [] this->FileName; 00074 } 00075 this->DirectoryName = NULL; 00076 this->FileName = NULL; 00077 this->vtkImageReader2::SetFileName(fn); 00078 } 00080 00087 void SetDirectoryName(const char* dn); 00088 00090 00091 vtkGetStringMacro(DirectoryName); 00093 00098 double* GetPixelSpacing(); 00099 00101 int GetWidth(); 00102 00104 int GetHeight(); 00105 00109 float* GetImagePositionPatient(); 00110 00114 float* GetImageOrientationPatient(); 00115 00117 int GetBitsAllocated(); 00118 00122 int GetPixelRepresentation(); 00123 00126 int GetNumberOfComponents(); 00127 00129 const char* GetTransferSyntaxUID(); 00130 00132 float GetRescaleSlope(); 00133 00135 float GetRescaleOffset(); 00136 00138 const char* GetPatientName(); 00139 00141 const char* GetStudyUID(); 00142 00144 const char* GetStudyID(); 00145 00147 float GetGantryAngle(); 00148 00149 // 00150 // Can I read the file? 00151 // 00152 virtual int CanReadFile(const char* fname); 00153 00154 // 00155 // What file extensions are supported? 00156 // 00157 virtual const char* GetFileExtensions() 00158 { 00159 return ".dcm"; 00160 } 00161 00163 00165 virtual const char* GetDescriptiveName() 00166 { 00167 return "DICOM"; 00168 } 00170 00171 protected: 00172 // 00173 // Setup the volume size 00174 // 00175 void SetupOutputInformation(int num_slices); 00176 00177 virtual void ExecuteInformation(); 00178 virtual void ExecuteData(vtkDataObject *out); 00179 00180 // 00181 // Constructor 00182 // 00183 vtkDICOMImageReader(); 00184 00185 // 00186 // Destructor 00187 // 00188 virtual ~vtkDICOMImageReader(); 00189 00190 // 00191 // Instance of the parser used to parse the file. 00192 // 00193 DICOMParser* Parser; 00194 00195 // 00196 // Instance of the callbacks that get the data from the file. 00197 // 00198 DICOMAppHelper* AppHelper; 00199 00200 // 00201 // vtkDICOMImageReaderVector wants to be a PIMPL and it will be, but not quite yet. 00202 // 00203 vtkDICOMImageReaderVector* DICOMFileNames; 00204 char* DirectoryName; 00205 00206 char* PatientName; 00207 char* StudyUID; 00208 char* StudyID; 00209 char* TransferSyntaxUID; 00210 00211 // DICOMFileNames accessor methods for subclasses: 00212 int GetNumberOfDICOMFileNames(); 00213 const char* GetDICOMFileName(int index); 00214 private: 00215 vtkDICOMImageReader(const vtkDICOMImageReader&); // Not implemented. 00216 void operator=(const vtkDICOMImageReader&); // Not implemented. 00217 00218 }; 00219 00220 #endif