VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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  if (this->DirectoryName)
72  {
73  delete [] this->DirectoryName;
74  }
75  if (this->FileName)
76  {
77  delete [] this->FileName;
78  }
79  this->DirectoryName = NULL;
80  this->FileName = NULL;
82  }
84 
91  void SetDirectoryName(const char* dn);
92 
94 
95  vtkGetStringMacro(DirectoryName);
97 
102  double* GetPixelSpacing();
103 
105  int GetWidth();
106 
108  int GetHeight();
109 
113  float* GetImagePositionPatient();
114 
118  float* GetImageOrientationPatient();
119 
121  int GetBitsAllocated();
122 
126  int GetPixelRepresentation();
127 
130  int GetNumberOfComponents();
131 
133  const char* GetTransferSyntaxUID();
134 
136  float GetRescaleSlope();
137 
139  float GetRescaleOffset();
140 
142  const char* GetPatientName();
143 
145  const char* GetStudyUID();
146 
148  const char* GetStudyID();
149 
151  float GetGantryAngle();
152 
153  //
154  // Can I read the file?
155  //
156  virtual int CanReadFile(const char* fname);
157 
158  //
159  // What file extensions are supported?
160  //
161  virtual const char* GetFileExtensions()
162  {
163  return ".dcm";
164  }
165 
167 
169  virtual const char* GetDescriptiveName()
170  {
171  return "DICOM";
172  }
174 
175 protected:
176  //
177  // Setup the volume size
178  //
179  void SetupOutputInformation(int num_slices);
180 
181  virtual void ExecuteInformation();
182  virtual void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo);
183 
184  //
185  // Constructor
186  //
188 
189  //
190  // Destructor
191  //
192  virtual ~vtkDICOMImageReader();
193 
194  //
195  // Instance of the parser used to parse the file.
196  //
197  DICOMParser* Parser;
198 
199  //
200  // Instance of the callbacks that get the data from the file.
201  //
202  DICOMAppHelper* AppHelper;
203 
204  //
205  // vtkDICOMImageReaderVector wants to be a PIMPL and it will be, but not quite yet.
206  //
207  vtkDICOMImageReaderVector* DICOMFileNames;
209 
210  char* PatientName;
211  char* StudyUID;
212  char* StudyID;
214 
215  // DICOMFileNames accessor methods for subclasses:
216  int GetNumberOfDICOMFileNames();
217  const char* GetDICOMFileName(int index);
218 private:
219  vtkDICOMImageReader(const vtkDICOMImageReader&); // Not implemented.
220  void operator=(const vtkDICOMImageReader&); // Not implemented.
221 
222 };
223 
224 #endif
static vtkImageReader2 * New()
GLuint index
Definition: vtkgl.h:11983
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.