VTK: IO/MINC/vtkMINCImageReader.h Source File

| VTK 9.3.1

vtkMINCImageReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) 2006 Atamai, Inc.
3 // SPDX-License-Identifier: BSD-3-Clause
30 #ifndef vtkMINCImageReader_h
31 #define vtkMINCImageReader_h
32
33 #include "vtkIOMINCModule.h" // For export macro
34 #include "vtkImageReader2.h"
35
36 VTK_ABI_NAMESPACE_BEGIN
37 class vtkStringArray;
38 class vtkIdTypeArray;
39 class vtkDoubleArray;
40 class vtkMatrix4x4;
41
42 // A special class that holds the attributes
43 class vtkMINCImageAttributes;
44
45 class VTKIOMINC_EXPORT vtkMINCImageReader : public vtkImageReader2
46 {
47 public:
48 vtkTypeMacro(vtkMINCImageReader, vtkImageReader2);
49
50 static vtkMINCImageReader* New();
51 void PrintSelf(ostream& os, vtkIndent indent) override;
52
56 void SetFileName(VTK_FILEPATH const char* name) override;
57
61 const char* GetFileExtensions() override { return ".mnc"; }
62
66 const char* GetDescriptiveName() override { return "MINC"; }
67
71 int CanReadFile(VTK_FILEPATH const char* name) override;
72
78 virtual vtkMatrix4x4* GetDirectionCosines();
79
81
86 virtual double GetRescaleSlope();
87 virtual double GetRescaleIntercept();
89
91
96 vtkSetMacro(RescaleRealValues, vtkTypeBool);
97 vtkBooleanMacro(RescaleRealValues, vtkTypeBool);
98 vtkGetMacro(RescaleRealValues, vtkTypeBool);
100
102
108 virtual double* GetDataRange() VTK_SIZEHINT(2);
109 virtual void GetDataRange(double range[2])
110 {
111 double* r = this->GetDataRange();
112 range[0] = r[0];
113 range[1] = r[1];
114 }
116
120 virtual int GetNumberOfTimeSteps();
121
123
126 vtkSetMacro(TimeStep, int);
127 vtkGetMacro(TimeStep, int);
129
134 virtual vtkMINCImageAttributes* GetImageAttributes();
135
136 protected:
137 vtkMINCImageReader();
138 ~vtkMINCImageReader() override;
139
140 int MINCImageType;
141 int MINCImageTypeSigned;
142
143 double ValidRange[2];
144 double ImageRange[2];
145 double DataRange[2];
146
147 int NumberOfTimeSteps;
148 int TimeStep;
149 vtkMatrix4x4* DirectionCosines;
150 double RescaleSlope;
151 double RescaleIntercept;
152 vtkTypeBool RescaleRealValues;
153 vtkMINCImageAttributes* ImageAttributes;
154
155 int FileNameHasChanged;
156
157 virtual int OpenNetCDFFile(const char* filename, int& ncid);
158 virtual int CloseNetCDFFile(int ncid);
159 virtual int IndexFromDimensionName(const char* dimName);
160 virtual int ReadMINCFileAttributes();
161 virtual void FindRangeAndRescaleValues();
162 static int ConvertMINCTypeToVTKType(int minctype, int mincsigned);
163
164 void ExecuteInformation() override;
165 void ExecuteDataWithInformation(vtkDataObject* out, vtkInformation* outInfo) override;
166
167 private:
168 vtkMINCImageReader(const vtkMINCImageReader&) = delete;
169 void operator=(const vtkMINCImageReader&) = delete;
170 };
171
172 VTK_ABI_NAMESPACE_END
173 #endif
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:64
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:40
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:37
vtkImageReader2
Superclass of binary file readers.
Definition: vtkImageReader2.h:57
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkMINCImageAttributes
A container for a MINC image header.
Definition: vtkMINCImageAttributes.h:44
vtkMINCImageReader
A reader for MINC files.
Definition: vtkMINCImageReader.h:46
vtkMINCImageReader::GetRescaleIntercept
virtual double GetRescaleIntercept()
Get the slope and intercept for rescaling the scalar values to real data values.
vtkMINCImageReader::CloseNetCDFFile
virtual int CloseNetCDFFile(int ncid)
vtkMINCImageReader::GetDataRange
virtual double * GetDataRange()
Get the scalar range of the output from the information in the file header.
vtkMINCImageReader::SetFileName
void SetFileName(VTK_FILEPATH const char *name) override
Set the file name.
vtkMINCImageReader::ExecuteDataWithInformation
void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
vtkMINCImageReader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMINCImageReader::IndexFromDimensionName
virtual int IndexFromDimensionName(const char *dimName)
vtkMINCImageReader::GetRescaleSlope
virtual double GetRescaleSlope()
Get the slope and intercept for rescaling the scalar values to real data values.
vtkMINCImageReader::~vtkMINCImageReader
~vtkMINCImageReader() override
vtkMINCImageReader::MINCImageTypeSigned
int MINCImageTypeSigned
Definition: vtkMINCImageReader.h:141
vtkMINCImageReader::RescaleIntercept
double RescaleIntercept
Definition: vtkMINCImageReader.h:151
vtkMINCImageReader::GetImageAttributes
virtual vtkMINCImageAttributes * GetImageAttributes()
Get the image attributes, which contain patient information and other useful metadata.
vtkMINCImageReader::ConvertMINCTypeToVTKType
static int ConvertMINCTypeToVTKType(int minctype, int mincsigned)
vtkMINCImageReader::FileNameHasChanged
int FileNameHasChanged
Definition: vtkMINCImageReader.h:155
vtkMINCImageReader::GetDescriptiveName
const char * GetDescriptiveName() override
Get the name of this file format.
Definition: vtkMINCImageReader.h:66
vtkMINCImageReader::NumberOfTimeSteps
int NumberOfTimeSteps
Definition: vtkMINCImageReader.h:147
vtkMINCImageReader::GetFileExtensions
const char * GetFileExtensions() override
Get the extension for this file format.
Definition: vtkMINCImageReader.h:61
vtkMINCImageReader::New
static vtkMINCImageReader * New()
vtkMINCImageReader::OpenNetCDFFile
virtual int OpenNetCDFFile(const char *filename, int &ncid)
vtkMINCImageReader::ImageAttributes
vtkMINCImageAttributes * ImageAttributes
Definition: vtkMINCImageReader.h:153
vtkMINCImageReader::vtkMINCImageReader
vtkMINCImageReader()
vtkMINCImageReader::ExecuteInformation
void ExecuteInformation() override
vtkMINCImageReader::ReadMINCFileAttributes
virtual int ReadMINCFileAttributes()
vtkMINCImageReader::RescaleSlope
double RescaleSlope
Definition: vtkMINCImageReader.h:150
vtkMINCImageReader::GetDirectionCosines
virtual vtkMatrix4x4 * GetDirectionCosines()
Get a matrix that describes the orientation of the data.
vtkMINCImageReader::RescaleRealValues
vtkTypeBool RescaleRealValues
Definition: vtkMINCImageReader.h:152
vtkMINCImageReader::GetNumberOfTimeSteps
virtual int GetNumberOfTimeSteps()
Get the number of time steps in the file.
vtkMINCImageReader::FindRangeAndRescaleValues
virtual void FindRangeAndRescaleValues()
vtkMINCImageReader::CanReadFile
int CanReadFile(VTK_FILEPATH const char *name) override
Test whether the specified file can be read.
vtkMINCImageReader::MINCImageType
int MINCImageType
Definition: vtkMINCImageReader.h:140
vtkMINCImageReader::DirectionCosines
vtkMatrix4x4 * DirectionCosines
Definition: vtkMINCImageReader.h:149
vtkMINCImageReader::TimeStep
int TimeStep
Definition: vtkMINCImageReader.h:148
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:40
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:41
vtkX3D::range
@ range
Definition: vtkX3D.h:238
vtkX3D::name
@ name
Definition: vtkX3D.h:219
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkImageReader2.h
VTK_FILEPATH
#define VTK_FILEPATH
Definition: vtkWrappingHints.h:34
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:36