VTK  9.2.6
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
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 }
82
83
93 void SetDirectoryName(VTK_FILEPATH const char* dn);
94
96
101
109
113 int GetWidth();
114
119
126
133
138
145
151
155 const char* GetTransferSyntaxUID();
156
161
166
170 const char* GetPatientName();
171
175 const char* GetStudyUID();
176
180 const char* GetStudyID();
181
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
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
void ExecuteInformation() override
int CanReadFile(VTK_FILEPATH const char *fname) override
const char * GetStudyUID()
Get the study uid for the last image processed.
void SetupOutputInformation(int num_slices)
static vtkDICOMImageReader * New()
Static method for construction.
const char * GetStudyID()
Get the Study ID for the last image processed.
vtkDICOMImageReaderVector * DICOMFileNames
DICOMAppHelper * AppHelper
float GetGantryAngle()
Get the gantry angle for the last image processed.
int GetHeight()
Returns the image height.
int GetNumberOfComponents()
Get the number of components of the image data for the last image processed.
float * GetImagePositionPatient()
Get the (DICOM) x,y,z coordinates of the first pixel in the image (upper left hand corner) of the las...
int GetPixelRepresentation()
Get the pixel representation of the last image processed by the DICOMParser.
float GetRescaleOffset()
Get the rescale offset for the pixel data.
int GetBitsAllocated()
Get the number of bits allocated for each pixel in the file.
const char * GetFileExtensions() override
Get the file extensions for this format.
double * GetPixelSpacing()
Returns the pixel spacing (in X, Y, Z).
float GetRescaleSlope()
Get the rescale slope for the pixel data.
void SetDirectoryName(VTK_FILEPATH const char *dn)
Set the directory name for the reader to look in for DICOM files.
int GetWidth()
Returns the image width.
float * GetImageOrientationPatient()
Get the (DICOM) directions cosines.
void SetFileName(VTK_FILEPATH const char *fn) override
Set the filename for the file to read.
const char * GetTransferSyntaxUID()
Get the transfer syntax UID for the last image processed.
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
const char * GetPatientName()
Get the patient name for the last image processed.
VTK_FILEPATH const char * GetDICOMFileName(int index)
vtkGetFilePathMacro(DirectoryName)
Returns the directory name.
general representation of visualization data
virtual void SetFileName(VTK_FILEPATH const char *)
Specify file name for the image file.
vtkImageReader2()
Return a descriptive name for the file format that might be useful in a GUI.
a simple class to control print indentation
Definition vtkIndent.h:40
Store vtkAlgorithm input/output information.
#define VTK_FILEPATH
#define VTK_SIZEHINT(...)