dox/IO/vtkDICOMImageReader.h

Go to the documentation of this file.
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 =========================================================================*/
00025 #ifndef __vtkDICOMImageReader_h
00026 #define __vtkDICOMImageReader_h
00027 
00028 #include "vtkImageReader2.h"
00029 
00030 //BTX
00031 class vtkDICOMImageReaderVector;
00032 class DICOMParser;
00033 class DICOMAppHelper;
00034 //ETX
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   // Can I read the file?
00129   //
00130   virtual int CanReadFile(const char* fname);
00131 
00132 protected:
00133   //
00134   // Setup the volume size
00135   //
00136   void SetupOutputInformation(int num_slices);
00137 
00138   //
00139   // What file extensions are supported?
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   // Constructor
00160   //
00161   vtkDICOMImageReader();
00162 
00163   //
00164   // Destructor
00165   //
00166   virtual ~vtkDICOMImageReader();
00167 
00168   //
00169   // Instance of the parser used to parse the file.
00170   //
00171   DICOMParser* Parser;
00172 
00173   //
00174   // Instance of the callbacks that get the data from the file.
00175   //
00176   DICOMAppHelper* AppHelper;
00177 
00178   //
00179   // vtkDICOMImageReaderVector wants to be a PIMPL and it will be, but not quite yet.
00180   //
00181   vtkDICOMImageReaderVector* DICOMFileNames;
00182   char* DirectoryName;
00183 
00184   char* PatientName;
00185   char* StudyUID;
00186   char* StudyID;
00187   char* TransferSyntaxUID;
00188 
00189   // DICOMFileNames accessor methods for subclasses:
00190   int GetNumberOfDICOMFileNames();
00191   const char* GetDICOMFileName(int index);
00192 private:
00193   vtkDICOMImageReader(const vtkDICOMImageReader&);  // Not implemented.
00194   void operator=(const vtkDICOMImageReader&);  // Not implemented.
00195 
00196 };
00197 
00198 #endif

Generated on Sat Sep 2 03:28:49 2006 for VTK by  doxygen 1.4.7