VTK  9.1.0
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=========================================================================*/
46#ifndef vtkDICOMImageReader_h
47#define vtkDICOMImageReader_h
48
49#include "vtkIOImageModule.h" // For export macro
50#include "vtkImageReader2.h"
51
52class vtkDICOMImageReaderVector;
53class DICOMParser;
54class DICOMAppHelper;
55
56class VTKIOIMAGE_EXPORT vtkDICOMImageReader : public vtkImageReader2
57{
58public:
60
66
70 void PrintSelf(ostream& os, vtkIndent indent) override;
71
73
77 void SetFileName(VTK_FILEPATH const char* fn) override
78 {
79 delete[] this->DirectoryName;
80 delete[] this->FileName;
81 this->DirectoryName = nullptr;
82 this->FileName = nullptr;
84 }
86
96 void SetDirectoryName(VTK_FILEPATH const char* dn);
97
99
102 vtkGetFilePathMacro(DirectoryName);
104
112
116 int GetWidth();
117
121 int GetHeight();
122
128 float* GetImagePositionPatient() VTK_SIZEHINT(3);
129
135 float* GetImageOrientationPatient() VTK_SIZEHINT(6);
136
140 int GetBitsAllocated();
141
147 int GetPixelRepresentation();
148
153 int GetNumberOfComponents();
154
158 const char* GetTransferSyntaxUID();
159
163 float GetRescaleSlope();
164
168 float GetRescaleOffset();
169
173 const char* GetPatientName();
174
178 const char* GetStudyUID();
179
183 const char* GetStudyID();
184
188 float GetGantryAngle();
189
190 //
191 // Can I read the file?
192 //
193 int CanReadFile(VTK_FILEPATH const char* fname) override;
194
195 //
196 // What file extensions are supported?
197 //
198 const char* GetFileExtensions() override { return ".dcm"; }
199
203 const char* GetDescriptiveName() override { return "DICOM"; }
204
205protected:
206 //
207 // Setup the volume size
208 //
209 void SetupOutputInformation(int num_slices);
210
211 void ExecuteInformation() override;
213
214 //
215 // Constructor
216 //
218
219 //
220 // Destructor
221 //
223
224 //
225 // Instance of the parser used to parse the file.
226 //
227 DICOMParser* Parser;
228
229 //
230 // Instance of the callbacks that get the data from the file.
231 //
232 DICOMAppHelper* AppHelper;
233
234 //
235 // vtkDICOMImageReaderVector wants to be a PIMPL and it will be, but not quite yet.
236 //
237 vtkDICOMImageReaderVector* DICOMFileNames;
239
241 char* StudyUID;
242 char* StudyID;
244
245 // DICOMFileNames accessor methods for subclasses:
248
249private:
251 void operator=(const vtkDICOMImageReader&) = delete;
252};
253
254#endif
Reads some DICOM images.
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
void ExecuteInformation() override
void SetupOutputInformation(int num_slices)
static vtkDICOMImageReader * New()
Static method for construction.
vtkDICOMImageReaderVector * DICOMFileNames
DICOMAppHelper * AppHelper
double * GetPixelSpacing()
Returns the pixel spacing (in X, Y, Z).
void SetDirectoryName(VTK_FILEPATH const char *dn)
Set the directory name for the reader to look in for DICOM files.
void SetFileName(VTK_FILEPATH const char *fn) override
Set the filename for the file to read.
int GetNumberOfDICOMFileNames()
void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
void PrintSelf(ostream &os, vtkIndent indent) override
Prints the ivars.
~vtkDICOMImageReader() override
VTK_FILEPATH const char * GetDICOMFileName(int index)
vtkGetFilePathMacro(DirectoryName)
Returns the directory name.
general representation of visualization data
Definition: vtkDataObject.h:69
Superclass of binary file readers.
virtual void SetFileName(VTK_FILEPATH const char *)
Specify file name for the image file.
a simple class to control print indentation
Definition: vtkIndent.h:43
Store vtkAlgorithm input/output information.
@ index
Definition: vtkX3D.h:252
#define VTK_FILEPATH
#define VTK_SIZEHINT(...)