VTK  9.3.1
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 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkTransform;
29 
30 #define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0
31 #define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1
32 
33 class VTKIOIMAGE_EXPORT vtkImageReader : public vtkImageReader2
34 {
35 public:
36  static vtkImageReader* New();
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]);
74  void ComputeInverseTransformedIncrements(vtkIdType inIncr[3], vtkIdType outIncr[3]);
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 
97 protected:
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]);
108  void ComputeTransformedIncrements(vtkIdType inIncr[3], vtkIdType outIncr[3]);
109 
110  int DataVOI[6];
111 
113 
114  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
115  vtkInformationVector* outputVector) override;
116 
118 
119 private:
120  vtkImageReader(const vtkImageReader&) = delete;
121  void operator=(const vtkImageReader&) = delete;
122 };
123 
124 VTK_ABI_NAMESPACE_END
125 #endif
static vtkImageReader2 * New()
Store vtkAlgorithm input/output information.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:49
int vtkIdType
Definition: vtkType.h:315
void ExecuteDataWithInformation(vtkDataObject *data, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
vtkTypeUInt64 DataMask
a simple class to control print indentation
Definition: vtkIndent.h:28
Superclass of transformable binary file readers.
vtkTransform * Transform
int CanReadFile(VTK_FILEPATH const char *) override
vtkImageReader itself can read raw binary files.
Superclass of binary file readers.
#define VTK_FILEPATH
int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
Store zero or more vtkInformation instances.
char * ScalarArrayName
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
general representation of visualization data
Definition: vtkDataObject.h:54