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 "vtkImageReader2.h"
46 
47 //BTX
48 class vtkDICOMImageReaderVector;
49 class DICOMParser;
50 class DICOMAppHelper;
51 //ETX
52 
54 {
55  public:
57 
58  static vtkDICOMImageReader *New();
61 
63  void PrintSelf(ostream& os, vtkIndent indent);
64 
66 
68  void SetFileName(const char* fn)
69  {
70  if (this->DirectoryName)
71  {
72  delete [] this->DirectoryName;
73  }
74  if (this->FileName)
75  {
76  delete [] this->FileName;
77  }
78  this->DirectoryName = NULL;
79  this->FileName = NULL;
81  }
83 
90  void SetDirectoryName(const char* dn);
91 
93 
94  vtkGetStringMacro(DirectoryName);
96 
101  double* GetPixelSpacing();
102 
104  int GetWidth();
105 
107  int GetHeight();
108 
112  float* GetImagePositionPatient();
113 
117  float* GetImageOrientationPatient();
118 
120  int GetBitsAllocated();
121 
125  int GetPixelRepresentation();
126 
129  int GetNumberOfComponents();
130 
132  const char* GetTransferSyntaxUID();
133 
135  float GetRescaleSlope();
136 
138  float GetRescaleOffset();
139 
141  const char* GetPatientName();
142 
144  const char* GetStudyUID();
145 
147  const char* GetStudyID();
148 
150  float GetGantryAngle();
151 
152  //
153  // Can I read the file?
154  //
155  virtual int CanReadFile(const char* fname);
156 
157  //
158  // What file extensions are supported?
159  //
160  virtual const char* GetFileExtensions()
161  {
162  return ".dcm";
163  }
164 
166 
168  virtual const char* GetDescriptiveName()
169  {
170  return "DICOM";
171  }
173 
174 protected:
175  //
176  // Setup the volume size
177  //
178  void SetupOutputInformation(int num_slices);
179 
180  virtual void ExecuteInformation();
181  virtual void ExecuteData(vtkDataObject *out);
182 
183  //
184  // Constructor
185  //
187 
188  //
189  // Destructor
190  //
191  virtual ~vtkDICOMImageReader();
192 
193  //
194  // Instance of the parser used to parse the file.
195  //
196  DICOMParser* Parser;
197 
198  //
199  // Instance of the callbacks that get the data from the file.
200  //
201  DICOMAppHelper* AppHelper;
202 
203  //
204  // vtkDICOMImageReaderVector wants to be a PIMPL and it will be, but not quite yet.
205  //
206  vtkDICOMImageReaderVector* DICOMFileNames;
208 
209  char* PatientName;
210  char* StudyUID;
211  char* StudyID;
213 
214  // DICOMFileNames accessor methods for subclasses:
215  int GetNumberOfDICOMFileNames();
216  const char* GetDICOMFileName(int index);
217 private:
218  vtkDICOMImageReader(const vtkDICOMImageReader&); // Not implemented.
219  void operator=(const vtkDICOMImageReader&); // Not implemented.
220 
221 };
222 
223 #endif
static vtkImageReader2 * New()
virtual void ExecuteData(vtkDataObject *data)
virtual const char * GetDescriptiveName()
virtual int CanReadFile(const char *vtkNotUsed(fname))
a simple class to control print indentation
Definition: vtkIndent.h:37
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 VTK_IO_EXPORT
general representation of visualization data
Definition: vtkDataObject.h:70
virtual const char * GetFileExtensions()
vtkDICOMImageReaderVector * DICOMFileNames
Reads some DICOM images.