VTK  9.1.0
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 =========================================================================*/
27 #ifndef vtkImageReader_h
28 #define vtkImageReader_h
29 
30 #include "vtkIOImageModule.h" // For export macro
31 #include "vtkImageReader2.h"
32 
33 class vtkTransform;
34 
35 #define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0
36 #define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1
37 
38 class VTKIOIMAGE_EXPORT vtkImageReader : public vtkImageReader2
39 {
40 public:
41  static vtkImageReader* New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
46 
50  vtkSetVector6Macro(DataVOI, int);
51  vtkGetVector6Macro(DataVOI, int);
53 
55 
62  vtkGetMacro(DataMask, vtkTypeUInt64);
63  vtkSetMacro(DataMask, vtkTypeUInt64);
65 
67 
72  virtual void SetTransform(vtkTransform*);
73  vtkGetObjectMacro(Transform, vtkTransform);
75 
76  // Warning !!!
77  // following should only be used by methods or template helpers, not users
78  void ComputeInverseTransformedExtent(int inExtent[6], int outExtent[6]);
80 
81  int OpenAndSeekFile(int extent[6], int slice);
82 
84 
87  vtkSetStringMacro(ScalarArrayName);
88  vtkGetStringMacro(ScalarArrayName);
90 
97  int CanReadFile(VTK_FILEPATH const char*) override
98  {
99  return 1; // I think I can read the file but I cannot prove it
100  }
101 
102 protected:
104  ~vtkImageReader() override;
105 
106  vtkTypeUInt64 DataMask;
107 
109 
110  void ComputeTransformedSpacing(double Spacing[3]);
111  void ComputeTransformedOrigin(double origin[3]);
112  void ComputeTransformedExtent(int inExtent[6], int outExtent[6]);
113  void ComputeTransformedIncrements(vtkIdType inIncr[3], vtkIdType outIncr[3]);
114 
115  int DataVOI[6];
116 
118 
120  vtkInformationVector* outputVector) override;
121 
123 
124 private:
125  vtkImageReader(const vtkImageReader&) = delete;
126  void operator=(const vtkImageReader&) = delete;
127 };
128 
129 #endif
general representation of visualization data
Definition: vtkDataObject.h:60
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:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:55
@ Transform
Definition: vtkX3D.h:47
@ extent
Definition: vtkX3D.h:351
@ data
Definition: vtkX3D.h:321
int vtkIdType
Definition: vtkType.h:332
#define VTK_FILEPATH