VTK
vtkDICOMImageReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDICOMImageReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
43 #ifndef vtkDICOMImageReader_h
44 #define vtkDICOMImageReader_h
45 
46 #include "vtkIOImageModule.h" // For export macro
47 #include "vtkImageReader2.h"
48 
49 class vtkDICOMImageReaderVector;
50 class DICOMParser;
51 class DICOMAppHelper;
52 
53 class VTKIOIMAGE_EXPORT vtkDICOMImageReader : public vtkImageReader2
54 {
55  public:
57 
63 
67  void PrintSelf(ostream& os, vtkIndent indent);
68 
70 
74  void SetFileName(const char* fn)
75  {
76  delete [] this->DirectoryName;
77  delete [] this->FileName;
78  this->DirectoryName = NULL;
79  this->FileName = NULL;
81  }
83 
93  void SetDirectoryName(const char* dn);
94 
96 
99  vtkGetStringMacro(DirectoryName);
101 
108  double* GetPixelSpacing();
109 
113  int GetWidth();
114 
118  int GetHeight();
119 
126 
133 
138 
145 
151 
155  const char* GetTransferSyntaxUID();
156 
161 
166 
170  const char* GetPatientName();
171 
175  const char* GetStudyUID();
176 
180  const char* GetStudyID();
181 
185  float GetGantryAngle();
186 
187  //
188  // Can I read the file?
189  //
190  virtual int CanReadFile(const char* fname);
191 
192  //
193  // What file extensions are supported?
194  //
195  virtual const char* GetFileExtensions()
196  {
197  return ".dcm";
198  }
199 
203  virtual const char* GetDescriptiveName()
204  {
205  return "DICOM";
206  }
207 
208 protected:
209  //
210  // Setup the volume size
211  //
212  void SetupOutputInformation(int num_slices);
213 
214  virtual void ExecuteInformation();
216 
217  //
218  // Constructor
219  //
221 
222  //
223  // Destructor
224  //
226 
227  //
228  // Instance of the parser used to parse the file.
229  //
230  DICOMParser* Parser;
231 
232  //
233  // Instance of the callbacks that get the data from the file.
234  //
235  DICOMAppHelper* AppHelper;
236 
237  //
238  // vtkDICOMImageReaderVector wants to be a PIMPL and it will be, but not quite yet.
239  //
240  vtkDICOMImageReaderVector* DICOMFileNames;
242 
243  char* PatientName;
244  char* StudyUID;
245  char* StudyID;
247 
248  // DICOMFileNames accessor methods for subclasses:
250  const char* GetDICOMFileName(int index);
251 private:
252  vtkDICOMImageReader(const vtkDICOMImageReader&) VTK_DELETE_FUNCTION;
253  void operator=(const vtkDICOMImageReader&) VTK_DELETE_FUNCTION;
254 
255 };
256 
257 #endif
vtkDICOMImageReader::ExecuteDataWithInformation
virtual void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo)
This is a convenience method that is implemented in many subclasses instead of RequestData.
vtkImageReader2::FileName
char * FileName
Definition: vtkImageReader2.h:316
vtkDICOMImageReader::GetPixelSpacing
double * GetPixelSpacing()
Returns the pixel spacing (in X, Y, Z).
vtkDICOMImageReader::GetFileExtensions
virtual const char * GetFileExtensions()
Get the file extensions for this format.
Definition: vtkDICOMImageReader.h:195
vtkDICOMImageReader::CanReadFile
virtual int CanReadFile(const char *fname)
vtkDICOMImageReader::PatientName
char * PatientName
Definition: vtkDICOMImageReader.h:243
vtkDICOMImageReader::GetNumberOfDICOMFileNames
int GetNumberOfDICOMFileNames()
vtkDICOMImageReader::GetPixelRepresentation
int GetPixelRepresentation()
Get the pixel representation of the last image processed by the DICOMParser.
vtkDICOMImageReader
Reads some DICOM images.
Definition: vtkDICOMImageReader.h:54
vtkDICOMImageReader::GetDICOMFileName
const char * GetDICOMFileName(int index)
vtkDICOMImageReader::ExecuteInformation
virtual void ExecuteInformation()
vtkDICOMImageReader::GetImagePositionPatient
float * GetImagePositionPatient()
Get the (DICOM) x,y,z coordinates of the first pixel in the image (upper left hand corner) of the las...
vtkDICOMImageReader::DirectoryName
char * DirectoryName
Definition: vtkDICOMImageReader.h:241
vtkDICOMImageReader::GetPatientName
const char * GetPatientName()
Get the patient name for the last image processed.
vtkDICOMImageReader::GetStudyUID
const char * GetStudyUID()
Get the study uid for the last image processed.
vtkDICOMImageReader::GetBitsAllocated
int GetBitsAllocated()
Get the number of bits allocated for each pixel in the file.
vtkDICOMImageReader::New
static vtkDICOMImageReader * New()
Static method for construction.
vtkDICOMImageReader::Parser
DICOMParser * Parser
Definition: vtkDICOMImageReader.h:230
vtkDICOMImageReader::GetNumberOfComponents
int GetNumberOfComponents()
Get the number of components of the image data for the last image processed.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkDICOMImageReader::GetImageOrientationPatient
float * GetImageOrientationPatient()
Get the (DICOM) directions cosines.
vtkDICOMImageReader::SetFileName
void SetFileName(const char *fn)
Set the filename for the file to read.
Definition: vtkDICOMImageReader.h:74
vtkImageReader2
Superclass of binary file readers.
Definition: vtkImageReader2.h:59
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkDICOMImageReader::DICOMFileNames
vtkDICOMImageReaderVector * DICOMFileNames
Definition: vtkDICOMImageReader.h:240
vtkDICOMImageReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Prints the ivars.
vtkImageReader2::SetFileName
virtual void SetFileName(const char *)
Specify file name for the image file.
vtkDICOMImageReader::SetDirectoryName
void SetDirectoryName(const char *dn)
Set the directory name for the reader to look in for DICOM files.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkDICOMImageReader::GetDescriptiveName
virtual const char * GetDescriptiveName()
Return a descriptive name for the file format that might be useful in a GUI.
Definition: vtkDICOMImageReader.h:203
vtkDICOMImageReader::GetTransferSyntaxUID
const char * GetTransferSyntaxUID()
Get the transfer syntax UID for the last image processed.
vtkDICOMImageReader::GetWidth
int GetWidth()
Returns the image width.
vtkDICOMImageReader::~vtkDICOMImageReader
virtual ~vtkDICOMImageReader()
vtkDICOMImageReader::TransferSyntaxUID
char * TransferSyntaxUID
Definition: vtkDICOMImageReader.h:246
vtkDICOMImageReader::GetHeight
int GetHeight()
Returns the image height.
vtkDICOMImageReader::AppHelper
DICOMAppHelper * AppHelper
Definition: vtkDICOMImageReader.h:235
vtkDICOMImageReader::StudyID
char * StudyID
Definition: vtkDICOMImageReader.h:245
vtkDICOMImageReader::vtkDICOMImageReader
vtkDICOMImageReader()
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkX3D::index
@ index
Definition: vtkX3D.h:246
vtkDICOMImageReader::GetStudyID
const char * GetStudyID()
Get the Study ID for the last image processed.
vtkDICOMImageReader::StudyUID
char * StudyUID
Definition: vtkDICOMImageReader.h:244
vtkDICOMImageReader::GetRescaleOffset
float GetRescaleOffset()
Get the rescale offset for the pixel data.
vtkDICOMImageReader::SetupOutputInformation
void SetupOutputInformation(int num_slices)
vtkDICOMImageReader::GetRescaleSlope
float GetRescaleSlope()
Get the rescale slope for the pixel data.
vtkImageReader2.h
vtkDICOMImageReader::GetGantryAngle
float GetGantryAngle()
Get the gantry angle for the last image processed.