VTK
dox/IO/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 "vtkImageReader2.h"
00046 
00047 //BTX
00048 class vtkDICOMImageReaderVector;
00049 class DICOMParser;
00050 class DICOMAppHelper;
00051 //ETX
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   // Can I read the file?
00154   //
00155   virtual int CanReadFile(const char* fname);
00156 
00157   //
00158   // What file extensions are supported?
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   // Setup the volume size
00177   //
00178   void SetupOutputInformation(int num_slices);
00179 
00180   virtual void ExecuteInformation();
00181   virtual void ExecuteData(vtkDataObject *out);
00182 
00183   //
00184   // Constructor
00185   //
00186   vtkDICOMImageReader();
00187 
00188   //
00189   // Destructor
00190   //
00191   virtual ~vtkDICOMImageReader();
00192 
00193   //
00194   // Instance of the parser used to parse the file.
00195   //
00196   DICOMParser* Parser;
00197 
00198   //
00199   // Instance of the callbacks that get the data from the file.
00200   //
00201   DICOMAppHelper* AppHelper;
00202 
00203   //
00204   // vtkDICOMImageReaderVector wants to be a PIMPL and it will be, but not quite yet.
00205   //
00206   vtkDICOMImageReaderVector* DICOMFileNames;
00207   char* DirectoryName;
00208 
00209   char* PatientName;
00210   char* StudyUID;
00211   char* StudyID;
00212   char* TransferSyntaxUID;
00213 
00214   // DICOMFileNames accessor methods for subclasses:
00215   int GetNumberOfDICOMFileNames();
00216   const char* GetDICOMFileName(int index);
00217 private:
00218   vtkDICOMImageReader(const vtkDICOMImageReader&);  // Not implemented.
00219   void operator=(const vtkDICOMImageReader&);  // Not implemented.
00220 
00221 };
00222 
00223 #endif