VTK  9.2.6
vtkImageReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
42 #ifndef vtkImageReader_h
43 #define vtkImageReader_h
44 
45 #include "vtkIOImageModule.h" // For export macro
46 #include "vtkImageReader2.h"
47 
48 class vtkTransform;
49 
50 #define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0
51 #define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1
52 
53 class VTKIOIMAGE_EXPORT vtkImageReader : public vtkImageReader2
54 {
55 public:
56  static vtkImageReader* New();
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
61 
65  vtkSetVector6Macro(DataVOI, int);
66  vtkGetVector6Macro(DataVOI, int);
68 
70 
77  vtkGetMacro(DataMask, vtkTypeUInt64);
78  vtkSetMacro(DataMask, vtkTypeUInt64);
80 
82 
87  virtual void SetTransform(vtkTransform*);
88  vtkGetObjectMacro(Transform, vtkTransform);
90 
91  // Warning !!!
92  // following should only be used by methods or template helpers, not users
93  void ComputeInverseTransformedExtent(int inExtent[6], int outExtent[6]);
95 
96  int OpenAndSeekFile(int extent[6], int slice);
97 
99 
102  vtkSetStringMacro(ScalarArrayName);
103  vtkGetStringMacro(ScalarArrayName);
105 
112  int CanReadFile(VTK_FILEPATH const char*) override
113  {
114  return 1; // I think I can read the file but I cannot prove it
115  }
116 
117 protected:
119  ~vtkImageReader() override;
120 
121  vtkTypeUInt64 DataMask;
122 
124 
125  void ComputeTransformedSpacing(double Spacing[3]);
126  void ComputeTransformedOrigin(double origin[3]);
127  void ComputeTransformedExtent(int inExtent[6], int outExtent[6]);
128  void ComputeTransformedIncrements(vtkIdType inIncr[3], vtkIdType outIncr[3]);
129 
130  int DataVOI[6];
131 
133 
135  vtkInformationVector* outputVector) override;
136 
138 
139 private:
140  vtkImageReader(const vtkImageReader&) = delete;
141  void operator=(const vtkImageReader&) = delete;
142 };
143 
144 #endif
general representation of visualization data
Definition: vtkDataObject.h:75
Superclass of binary file readers.
Superclass of transformable binary file readers.
void ComputeTransformedExtent(int inExtent[6], int outExtent[6])
static vtkImageReader * New()
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)
char * ScalarArrayName
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:49
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:70
@ Transform
Definition: vtkX3D.h:47
@ extent
Definition: vtkX3D.h:351
@ data
Definition: vtkX3D.h:321
int vtkIdType
Definition: vtkType.h:332
#define VTK_FILEPATH