VTK  9.4.20241219
vtkImageReader.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
40#ifndef vtkImageReader_h
41#define vtkImageReader_h
42
43#include "vtkIOImageModule.h" // For export macro
44#include "vtkImageReader2.h"
45
46VTK_ABI_NAMESPACE_BEGIN
47class vtkTransform;
48
49#define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0
50#define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1
51
52class VTKIOIMAGE_EXPORT vtkImageReader : public vtkImageReader2
53{
54public:
57 void PrintSelf(ostream& os, vtkIndent indent) override;
58
60
64 vtkSetVector6Macro(DataVOI, int);
65 vtkGetVector6Macro(DataVOI, int);
67
69
76 vtkGetMacro(DataMask, vtkTypeUInt64);
77 vtkSetMacro(DataMask, vtkTypeUInt64);
79
81
86 virtual void SetTransform(vtkTransform*);
87 vtkGetObjectMacro(Transform, vtkTransform);
89
90 // Warning !!!
91 // following should only be used by methods or template helpers, not users
92 void ComputeInverseTransformedExtent(int inExtent[6], int outExtent[6]);
94
95 int OpenAndSeekFile(int extent[6], int slice);
96
98
101 vtkSetStringMacro(ScalarArrayName);
102 vtkGetStringMacro(ScalarArrayName);
104
111 int CanReadFile(VTK_FILEPATH const char*) override
112 {
113 return 1; // I think I can read the file but I cannot prove it
114 }
115
116protected:
118 ~vtkImageReader() override;
119
120 vtkTypeUInt64 DataMask;
121
123
124 void ComputeTransformedSpacing(double Spacing[3]);
125 void ComputeTransformedOrigin(double origin[3]);
126 void ComputeTransformedExtent(int inExtent[6], int outExtent[6]);
128
129 int DataVOI[6];
130
132
134 vtkInformationVector* outputVector) override;
135
137
138private:
139 vtkImageReader(const vtkImageReader&) = delete;
140 void operator=(const vtkImageReader&) = delete;
141};
142
143VTK_ABI_NAMESPACE_END
144#endif
general representation of visualization data
Superclass of binary file readers.
Superclass of transformable binary file readers.
static vtkImageReader * New()
void ComputeTransformedExtent(int inExtent[6], int outExtent[6])
int CanReadFile(VTK_FILEPATH const char *) override
vtkImageReader itself can read raw binary files.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkImageReader() override
void ComputeInverseTransformedExtent(int inExtent[6], int outExtent[6])
void ComputeTransformedSpacing(double Spacing[3])
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
int OpenAndSeekFile(int extent[6], int slice)
void ExecuteDataWithInformation(vtkDataObject *data, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
virtual void SetTransform(vtkTransform *)
Set/Get transformation matrix to transform the data from slice space into world space.
void ComputeTransformedOrigin(double origin[3])
void ComputeInverseTransformedIncrements(vtkIdType inIncr[3], vtkIdType outIncr[3])
vtkTypeUInt64 DataMask
void ComputeTransformedIncrements(vtkIdType inIncr[3], vtkIdType outIncr[3])
vtkTransform * Transform
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
describes linear transformations via a 4x4 matrix
int vtkIdType
Definition vtkType.h:315
#define VTK_FILEPATH