Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

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 =========================================================================*/
00037 #ifndef __vtkDICOMImageReader_h
00038 #define __vtkDICOMImageReader_h
00039 
00040 #include "vtkImageReader2.h"
00041 
00042 //BTX
00043 class vtkDICOMImageReaderVector;
00044 class DICOMParser;
00045 class DICOMAppHelper;
00046 //ETX
00047 
00048 class VTK_IO_EXPORT vtkDICOMImageReader : public vtkImageReader2
00049 {
00050  public:
00052 
00053   static vtkDICOMImageReader *New();
00054   vtkTypeRevisionMacro(vtkDICOMImageReader,vtkImageReader2);
00056 
00058   void PrintSelf(ostream& os, vtkIndent indent);
00059 
00061 
00063   void SetFileName(const char* fn)
00064   {
00065     if (this->DirectoryName)
00066       {
00067       delete [] this->DirectoryName;
00068       }
00069     if (this->FileName)
00070       {
00071       delete [] this->FileName;
00072       }
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 
00093   double* GetPixelSpacing();
00094 
00096   int GetWidth();
00097 
00099   int GetHeight();
00100 
00104   float* GetImagePositionPatient();
00105 
00107   int GetBitsAllocated();
00108 
00112   int GetPixelRepresentation();
00113 
00116   int GetNumberOfComponents();
00117 
00119   const char* GetTransferSyntaxUID();
00120 
00122   float GetRescaleSlope();
00123 
00125   float GetRescaleOffset();
00126 
00128   const char* GetPatientName();
00129 
00131   const char* GetStudyUID();
00132 
00134   const char* GetStudyID();
00135 
00137   float GetGantryAngle();
00138 
00139 protected:
00140   //
00141   // Setup the volume size
00142   //
00143   void SetupOutputInformation(int num_slices);
00144 
00145   //
00146   // Can I read the file?
00147   //
00148   virtual int CanReadFile(const char* fname);
00149 
00150   //
00151   // What file extensions are supported?
00152   //
00153   virtual const char* GetFileExtensions()
00154   {
00155     return ".dcm";
00156   }
00157 
00159 
00161   virtual const char* GetDescriptiveName()
00162   {
00163     return "DICOM";
00164   }
00166 
00167   virtual void ExecuteInformation();
00168   virtual void ExecuteData(vtkDataObject *out);
00169 
00170   //
00171   // Constructor
00172   //
00173   vtkDICOMImageReader();
00174 
00175   //
00176   // Destructor
00177   //
00178   virtual ~vtkDICOMImageReader();
00179 
00180   //
00181   // Instance of the parser used to parse the file.
00182   //
00183   DICOMParser* Parser;
00184 
00185   //
00186   // Instance of the callbacks that get the data from the file.
00187   //
00188   DICOMAppHelper* AppHelper;
00189 
00190   //
00191   // vtkDICOMImageReaderVector wants to be a PIMPL and it will be, but not quite yet.
00192   //
00193   vtkDICOMImageReaderVector* DICOMFileNames;
00194   char* DirectoryName;
00195 
00196   char* PatientName;
00197   char* StudyUID;
00198   char* StudyID;
00199   char* TransferSyntaxUID;
00200 
00201   // DICOMFileNames accessor methods for subclasses:
00202   int GetNumberOfDICOMFileNames();
00203   const char* GetDICOMFileName(int index);
00204 private:
00205   vtkDICOMImageReader(const vtkDICOMImageReader&);  // Not implemented.
00206   void operator=(const vtkDICOMImageReader&);  // Not implemented.
00207 
00208 };
00209 
00210 #endif