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 =========================================================================*/
42 #ifndef vtkDICOMImageReader_h
43 #define vtkDICOMImageReader_h
44 
45 #include "vtkIOImageModule.h" // For export macro
46 #include "vtkImageReader2.h"
47 
48 //BTX
49 class vtkDICOMImageReaderVector;
50 class DICOMParser;
51 class DICOMAppHelper;
52 //ETX
53 
55 {
56  public:
58 
59  static vtkDICOMImageReader *New();
62 
64  void PrintSelf(ostream& os, vtkIndent indent);
65 
67 
69  void SetFileName(const char* fn)
70  {
71  delete [] this->DirectoryName;
72  delete [] this->FileName;
73  this->DirectoryName = NULL;
74  this->FileName = NULL;
76  }
78 
85  void SetDirectoryName(const char* dn);
86 
88 
89  vtkGetStringMacro(DirectoryName);
91 
96  double* GetPixelSpacing();
97 
99  int GetWidth();
100 
102  int GetHeight();
103 
107  float* GetImagePositionPatient();
108 
112  float* GetImageOrientationPatient();
113 
115  int GetBitsAllocated();
116 
120  int GetPixelRepresentation();
121 
124  int GetNumberOfComponents();
125 
127  const char* GetTransferSyntaxUID();
128 
130  float GetRescaleSlope();
131 
133  float GetRescaleOffset();
134 
136  const char* GetPatientName();
137 
139  const char* GetStudyUID();
140 
142  const char* GetStudyID();
143 
145  float GetGantryAngle();
146 
147  //
148  // Can I read the file?
149  //
150  virtual int CanReadFile(const char* fname);
151 
152  //
153  // What file extensions are supported?
154  //
155  virtual const char* GetFileExtensions()
156  {
157  return ".dcm";
158  }
159 
161 
163  virtual const char* GetDescriptiveName()
164  {
165  return "DICOM";
166  }
168 
169 protected:
170  //
171  // Setup the volume size
172  //
173  void SetupOutputInformation(int num_slices);
174 
175  virtual void ExecuteInformation();
176  virtual void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo);
177 
178  //
179  // Constructor
180  //
182 
183  //
184  // Destructor
185  //
186  virtual ~vtkDICOMImageReader();
187 
188  //
189  // Instance of the parser used to parse the file.
190  //
191  DICOMParser* Parser;
192 
193  //
194  // Instance of the callbacks that get the data from the file.
195  //
196  DICOMAppHelper* AppHelper;
197 
198  //
199  // vtkDICOMImageReaderVector wants to be a PIMPL and it will be, but not quite yet.
200  //
201  vtkDICOMImageReaderVector* DICOMFileNames;
203 
204  char* PatientName;
205  char* StudyUID;
206  char* StudyID;
208 
209  // DICOMFileNames accessor methods for subclasses:
210  int GetNumberOfDICOMFileNames();
211  const char* GetDICOMFileName(int index);
212 private:
213  vtkDICOMImageReader(const vtkDICOMImageReader&); // Not implemented.
214  void operator=(const vtkDICOMImageReader&); // Not implemented.
215 
216 };
217 
218 #endif
static vtkImageReader2 * New()
Store vtkAlgorithm input/output information.
virtual const char * GetDescriptiveName()
virtual int CanReadFile(const char *vtkNotUsed(fname))
a simple class to control print indentation
Definition: vtkIndent.h:38
void SetFileName(const char *fn)
virtual void ExecuteInformation()
Superclass of binary file readers.
void PrintSelf(ostream &os, vtkIndent indent)
DICOMAppHelper * AppHelper
virtual void SetFileName(const char *)
#define VTKIOIMAGE_EXPORT
virtual void ExecuteDataWithInformation(vtkDataObject *data, vtkInformation *outInfo)
general representation of visualization data
Definition: vtkDataObject.h:64
virtual const char * GetFileExtensions()
vtkDICOMImageReaderVector * DICOMFileNames
Reads some DICOM images.