VTK  9.3.0
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
30#ifndef vtkImageReader_h
31#define vtkImageReader_h
32
33#include "vtkIOImageModule.h" // For export macro
34#include "vtkImageReader2.h"
35
36VTK_ABI_NAMESPACE_BEGIN
37class vtkTransform;
38
39#define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0
40#define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1
41
42class VTKIOIMAGE_EXPORT vtkImageReader : public vtkImageReader2
43{
44public:
47 void PrintSelf(ostream& os, vtkIndent indent) override;
48
50
54 vtkSetVector6Macro(DataVOI, int);
55 vtkGetVector6Macro(DataVOI, int);
57
59
66 vtkGetMacro(DataMask, vtkTypeUInt64);
67 vtkSetMacro(DataMask, vtkTypeUInt64);
69
71
76 virtual void SetTransform(vtkTransform*);
77 vtkGetObjectMacro(Transform, vtkTransform);
79
80 // Warning !!!
81 // following should only be used by methods or template helpers, not users
82 void ComputeInverseTransformedExtent(int inExtent[6], int outExtent[6]);
84
85 int OpenAndSeekFile(int extent[6], int slice);
86
88
91 vtkSetStringMacro(ScalarArrayName);
92 vtkGetStringMacro(ScalarArrayName);
94
101 int CanReadFile(VTK_FILEPATH const char*) override
102 {
103 return 1; // I think I can read the file but I cannot prove it
104 }
105
106protected:
108 ~vtkImageReader() override;
109
110 vtkTypeUInt64 DataMask;
111
113
114 void ComputeTransformedSpacing(double Spacing[3]);
115 void ComputeTransformedOrigin(double origin[3]);
116 void ComputeTransformedExtent(int inExtent[6], int outExtent[6]);
118
119 int DataVOI[6];
120
122
124 vtkInformationVector* outputVector) override;
125
127
128private:
129 vtkImageReader(const vtkImageReader&) = delete;
130 void operator=(const vtkImageReader&) = delete;
131};
132
133VTK_ABI_NAMESPACE_END
134#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:38
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