VTK  9.7.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 
82  vtkTypeInt64 ComputeStartOffset(int dataExtent[6], int idx);
83 
85 
88  vtkSetStringMacro(ScalarArrayName);
89  vtkGetStringMacro(ScalarArrayName);
91 
92  using Superclass::CanReadFile;
99  int CanReadFile(VTK_FILEPATH const char*) override
100  {
101  return 1; // I think I can read the file but I cannot prove it
102  }
103 
104 protected:
105  vtkImageReader();
106  ~vtkImageReader() override;
107 
108  vtkTypeUInt64 DataMask;
109 
111 
112  void ComputeTransformedSpacing(double Spacing[3]);
113  void ComputeTransformedOrigin(double origin[3]);
114  void ComputeTransformedExtent(int inExtent[6], int outExtent[6]);
115  void ComputeTransformedIncrements(vtkIdType inIncr[3], vtkIdType outIncr[3]);
116 
117  int DataVOI[6];
118 
120 
121  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
122  vtkInformationVector* outputVector) override;
123 
125 
126 private:
127  vtkImageReader(const vtkImageReader&) = delete;
128  void operator=(const vtkImageReader&) = delete;
129 };
130 
131 VTK_ABI_NAMESPACE_END
132 #endif
static vtkImageReader2 * New()
Store vtkAlgorithm input/output information.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:50
int vtkIdType
Definition: vtkType.h:363
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
Superclass of binary file readers.
int CanReadFile(const char *) override
vtkImageReader itself can read raw binary files.
#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:55