VTK  9.5.20251112
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
33#ifndef vtkMINCImageReader_h
34#define vtkMINCImageReader_h
35
36#include "vtkIOMINCModule.h" // For export macro
37#include "vtkImageReader2.h"
38
39VTK_ABI_NAMESPACE_BEGIN
40class vtkStringArray;
41class vtkIdTypeArray;
42class vtkDoubleArray;
43class vtkMatrix4x4;
44
45// A special class that holds the attributes
47
48class VTKIOMINC_EXPORT vtkMINCImageReader : public vtkImageReader2
49{
50public:
52
54 void PrintSelf(ostream& os, vtkIndent indent) override;
55
59 void SetFileName(VTK_FILEPATH const char* name) override;
60
64 const char* GetFileExtensions() override { return ".mnc"; }
65
69 const char* GetDescriptiveName() override { return "MINC"; }
70
74 int CanReadFile(VTK_FILEPATH const char* name) override;
75
82
84
89 virtual double GetRescaleSlope();
90 virtual double GetRescaleIntercept();
92
94
99 vtkSetMacro(RescaleRealValues, vtkTypeBool);
100 vtkBooleanMacro(RescaleRealValues, vtkTypeBool);
101 vtkGetMacro(RescaleRealValues, vtkTypeBool);
103
105
111 virtual double* GetDataRange() VTK_SIZEHINT(2);
112 virtual void GetDataRange(double range[2])
113 {
114 double* r = this->GetDataRange();
115 range[0] = r[0];
116 range[1] = r[1];
117 }
119
123 virtual int GetNumberOfTimeSteps();
124
126
129 vtkSetMacro(TimeStep, int);
130 vtkGetMacro(TimeStep, int);
132
138
139protected:
142
145
146 double ValidRange[2];
147 double ImageRange[2];
148 double DataRange[2];
149
157
159
160 virtual int OpenNetCDFFile(const char* filename, int& ncid);
161 virtual int CloseNetCDFFile(int ncid);
162 virtual int IndexFromDimensionName(const char* dimName);
165 static int ConvertMINCTypeToVTKType(int minctype, int mincsigned);
166
167 void ExecuteInformation() override;
169
170private:
171 vtkMINCImageReader(const vtkMINCImageReader&) = delete;
172 void operator=(const vtkMINCImageReader&) = delete;
173};
174
175VTK_ABI_NAMESPACE_END
176#endif
general representation of visualization data
dynamic, self-adjusting array of double
dynamic, self-adjusting array of vtkIdType
Superclass of binary file readers.
a simple class to control print indentation
Definition vtkIndent.h:108
Store vtkAlgorithm input/output information.
A container for a MINC image header.
A reader for MINC files.
virtual double GetRescaleIntercept()
Get the slope and intercept for rescaling the scalar values to real data values.
virtual double * GetDataRange()
Get the scalar range of the output from the information in the file header.
virtual int CloseNetCDFFile(int ncid)
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
Methods invoked by print to print information about the object including superclasses.
virtual vtkMINCImageAttributes * GetImageAttributes()
Get the image attributes, which contain patient information and other useful metadata.
virtual int IndexFromDimensionName(const char *dimName)
int CanReadFile(const char *name) override
Test whether the specified file can be read.
virtual double GetRescaleSlope()
Get the slope and intercept for rescaling the scalar values to real data values.
~vtkMINCImageReader() override
virtual vtkMatrix4x4 * GetDirectionCosines()
Get a matrix that describes the orientation of the data.
static int ConvertMINCTypeToVTKType(int minctype, int mincsigned)
void SetFileName(const char *name) override
Set the file name.
const char * GetDescriptiveName() override
Get the name of this file format.
static vtkMINCImageReader * New()
virtual int OpenNetCDFFile(const char *filename, int &ncid)
vtkMINCImageAttributes * ImageAttributes
void ExecuteInformation() override
virtual int ReadMINCFileAttributes()
virtual int GetNumberOfTimeSteps()
Get the number of time steps in the file.
const char * GetFileExtensions() override
Get the extension for this file format.
virtual void FindRangeAndRescaleValues()
vtkMatrix4x4 * DirectionCosines
represent and manipulate 4x4 transformation matrices
a vtkAbstractArray subclass for strings
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_FILEPATH
#define VTK_SIZEHINT(...)