VTK
/Users/kitware/Dashboards/MyTests/VTK_BLD_Release_docs/Utilities/Doxygen/dox/IO/Image/vtkDICOMImageReader.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkDICOMImageReader.h
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 =========================================================================*/
00042 #ifndef vtkDICOMImageReader_h
00043 #define vtkDICOMImageReader_h
00044 
00045 #include "vtkIOImageModule.h" // For export macro
00046 #include "vtkImageReader2.h"
00047 
00048 //BTX
00049 class vtkDICOMImageReaderVector;
00050 class DICOMParser;
00051 class DICOMAppHelper;
00052 //ETX
00053 
00054 class VTKIOIMAGE_EXPORT vtkDICOMImageReader : public vtkImageReader2
00055 {
00056  public:
00058 
00059   static vtkDICOMImageReader *New();
00060   vtkTypeMacro(vtkDICOMImageReader,vtkImageReader2);
00062 
00064   void PrintSelf(ostream& os, vtkIndent indent);
00065 
00067 
00069   void SetFileName(const char* fn)
00070   {
00071     delete [] this->DirectoryName;
00072     delete [] this->FileName;
00073     this->DirectoryName = NULL;
00074     this->FileName = NULL;
00075     this->vtkImageReader2::SetFileName(fn);
00076   }
00078 
00085   void SetDirectoryName(const char* dn);
00086 
00088 
00089   vtkGetStringMacro(DirectoryName);
00091 
00096   double* GetPixelSpacing();
00097 
00099   int GetWidth();
00100 
00102   int GetHeight();
00103 
00107   float* GetImagePositionPatient();
00108 
00112   float* GetImageOrientationPatient();
00113 
00115   int GetBitsAllocated();
00116 
00120   int GetPixelRepresentation();
00121 
00124   int GetNumberOfComponents();
00125 
00127   const char* GetTransferSyntaxUID();
00128 
00130   float GetRescaleSlope();
00131 
00133   float GetRescaleOffset();
00134 
00136   const char* GetPatientName();
00137 
00139   const char* GetStudyUID();
00140 
00142   const char* GetStudyID();
00143 
00145   float GetGantryAngle();
00146 
00147   //
00148   // Can I read the file?
00149   //
00150   virtual int CanReadFile(const char* fname);
00151 
00152   //
00153   // What file extensions are supported?
00154   //
00155   virtual const char* GetFileExtensions()
00156   {
00157     return ".dcm";
00158   }
00159 
00161 
00163   virtual const char* GetDescriptiveName()
00164   {
00165     return "DICOM";
00166   }
00168 
00169 protected:
00170   //
00171   // Setup the volume size
00172   //
00173   void SetupOutputInformation(int num_slices);
00174 
00175   virtual void ExecuteInformation();
00176   virtual void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo);
00177 
00178   //
00179   // Constructor
00180   //
00181   vtkDICOMImageReader();
00182 
00183   //
00184   // Destructor
00185   //
00186   virtual ~vtkDICOMImageReader();
00187 
00188   //
00189   // Instance of the parser used to parse the file.
00190   //
00191   DICOMParser* Parser;
00192 
00193   //
00194   // Instance of the callbacks that get the data from the file.
00195   //
00196   DICOMAppHelper* AppHelper;
00197 
00198   //
00199   // vtkDICOMImageReaderVector wants to be a PIMPL and it will be, but not quite yet.
00200   //
00201   vtkDICOMImageReaderVector* DICOMFileNames;
00202   char* DirectoryName;
00203 
00204   char* PatientName;
00205   char* StudyUID;
00206   char* StudyID;
00207   char* TransferSyntaxUID;
00208 
00209   // DICOMFileNames accessor methods for subclasses:
00210   int GetNumberOfDICOMFileNames();
00211   const char* GetDICOMFileName(int index);
00212 private:
00213   vtkDICOMImageReader(const vtkDICOMImageReader&);  // Not implemented.
00214   void operator=(const vtkDICOMImageReader&);  // Not implemented.
00215 
00216 };
00217 
00218 #endif