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=========================================================================*/
36
37#ifndef vtkDICOMImageReader_h
38#define vtkDICOMImageReader_h
39
40#include "vtkIOImageModule.h" // For export macro
41#include "vtkImageReader2.h"
42
43class vtkDICOMImageReaderVector;
44class DICOMParser;
45class DICOMAppHelper;
46
47class VTKIOIMAGE_EXPORT vtkDICOMImageReader : public vtkImageReader2
48{
49public:
51
57
61 void PrintSelf(ostream& os, vtkIndent indent) override;
62
64
68 void SetFileName(VTK_FILEPATH const char* fn) override
69 {
70 delete[] this->DirectoryName;
71 delete[] this->FileName;
72 this->DirectoryName = nullptr;
73 this->FileName = nullptr;
75 }
76
77
87 void SetDirectoryName(VTK_FILEPATH const char* dn);
88
90
95
103
107 int GetWidth();
108
113
120
127
132
139
145
149 const char* GetTransferSyntaxUID();
150
155
160
164 const char* GetPatientName();
165
169 const char* GetStudyUID();
170
174 const char* GetStudyID();
175
180
181 //
182 // Can I read the file?
183 //
184 int CanReadFile(VTK_FILEPATH const char* fname) override;
185
186 //
187 // What file extensions are supported?
188 //
189 const char* GetFileExtensions() override { return ".dcm"; }
190
194 const char* GetDescriptiveName() override { return "DICOM"; }
195
196protected:
197 //
198 // Setup the volume size
199 //
200 void SetupOutputInformation(int num_slices);
201
202 void ExecuteInformation() override;
204
205 //
206 // Constructor
207 //
209
210 //
211 // Destructor
212 //
214
215 //
216 // Instance of the parser used to parse the file.
217 //
218 DICOMParser* Parser;
219
220 //
221 // Instance of the callbacks that get the data from the file.
222 //
223 DICOMAppHelper* AppHelper;
224
225 //
226 // vtkDICOMImageReaderVector wants to be a PIMPL and it will be, but not quite yet.
227 //
228 vtkDICOMImageReaderVector* DICOMFileNames;
230
232 char* StudyUID;
233 char* StudyID;
235
236 // DICOMFileNames accessor methods for subclasses:
238 VTK_FILEPATH const char* GetDICOMFileName(int index);
239
240private:
242 void operator=(const vtkDICOMImageReader&) = delete;
243};
244
245#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:34
Store vtkAlgorithm input/output information.
#define VTK_FILEPATH
#define VTK_SIZEHINT(...)