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
21#ifndef vtkImageReader_h
22#define vtkImageReader_h
23
24#include "vtkIOImageModule.h" // For export macro
25#include "vtkImageReader2.h"
26
27VTK_ABI_NAMESPACE_BEGIN
28class vtkTransform;
29
30#define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0
31#define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1
32
33class VTKIOIMAGE_EXPORT vtkImageReader : public vtkImageReader2
34{
35public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
41
45 vtkSetVector6Macro(DataVOI, int);
46 vtkGetVector6Macro(DataVOI, int);
48
50
57 vtkGetMacro(DataMask, vtkTypeUInt64);
58 vtkSetMacro(DataMask, vtkTypeUInt64);
60
62
67 virtual void SetTransform(vtkTransform*);
68 vtkGetObjectMacro(Transform, vtkTransform);
70
71 // Warning !!!
72 // following should only be used by methods or template helpers, not users
73 void ComputeInverseTransformedExtent(int inExtent[6], int outExtent[6]);
75
76 int OpenAndSeekFile(int extent[6], int slice);
77
79
82 vtkSetStringMacro(ScalarArrayName);
83 vtkGetStringMacro(ScalarArrayName);
85
92 int CanReadFile(VTK_FILEPATH const char*) override
93 {
94 return 1; // I think I can read the file but I cannot prove it
95 }
96
97protected:
99 ~vtkImageReader() override;
100
101 vtkTypeUInt64 DataMask;
102
104
105 void ComputeTransformedSpacing(double Spacing[3]);
106 void ComputeTransformedOrigin(double origin[3]);
107 void ComputeTransformedExtent(int inExtent[6], int outExtent[6]);
109
110 int DataVOI[6];
111
113
115 vtkInformationVector* outputVector) override;
116
118
119private:
120 vtkImageReader(const vtkImageReader&) = delete;
121 void operator=(const vtkImageReader&) = delete;
122};
123
124VTK_ABI_NAMESPACE_END
125#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:29
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