VTK  9.2.5
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
49class vtkDICOMImageReaderVector;
50class DICOMParser;
51class DICOMAppHelper;
52
53class VTKIOIMAGE_EXPORT vtkDICOMImageReader : public vtkImageReader2
54{
55public:
57
63
67 void PrintSelf(ostream& os, vtkIndent indent) override;
68
70
74 void SetFileName(VTK_FILEPATH const char* fn) override
75 {
76 delete[] this->DirectoryName;
77 delete[] this->FileName;
78 this->DirectoryName = nullptr;
79 this->FileName = nullptr;
81 }
83
93 void SetDirectoryName(VTK_FILEPATH const char* dn);
94
96
99 vtkGetFilePathMacro(DirectoryName);
101
109
113 int GetWidth();
114
118 int GetHeight();
119
125 float* GetImagePositionPatient() VTK_SIZEHINT(3);
126
132 float* GetImageOrientationPatient() VTK_SIZEHINT(6);
133
137 int GetBitsAllocated();
138
144 int GetPixelRepresentation();
145
150 int GetNumberOfComponents();
151
155 const char* GetTransferSyntaxUID();
156
160 float GetRescaleSlope();
161
165 float GetRescaleOffset();
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 int CanReadFile(VTK_FILEPATH const char* fname) override;
191
192 //
193 // What file extensions are supported?
194 //
195 const char* GetFileExtensions() override { return ".dcm"; }
196
200 const char* GetDescriptiveName() override { return "DICOM"; }
201
202protected:
203 //
204 // Setup the volume size
205 //
206 void SetupOutputInformation(int num_slices);
207
208 void ExecuteInformation() override;
210
211 //
212 // Constructor
213 //
215
216 //
217 // Destructor
218 //
220
221 //
222 // Instance of the parser used to parse the file.
223 //
224 DICOMParser* Parser;
225
226 //
227 // Instance of the callbacks that get the data from the file.
228 //
229 DICOMAppHelper* AppHelper;
230
231 //
232 // vtkDICOMImageReaderVector wants to be a PIMPL and it will be, but not quite yet.
233 //
234 vtkDICOMImageReaderVector* DICOMFileNames;
236
238 char* StudyUID;
239 char* StudyID;
241
242 // DICOMFileNames accessor methods for subclasses:
244 VTK_FILEPATH const char* GetDICOMFileName(int index);
245
246private:
248 void operator=(const vtkDICOMImageReader&) = delete;
249};
250
251#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:66
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:40
Store vtkAlgorithm input/output information.
#define VTK_FILEPATH
#define VTK_SIZEHINT(...)