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 =========================================================================*/
33 #ifndef vtkImageReader_h
34 #define vtkImageReader_h
35 
36 #include "vtkIOImageModule.h" // For export macro
37 #include "vtkImageReader2.h"
38 
39 class vtkTransform;
40 
41 #define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0
42 #define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1
43 
44 class VTKIOIMAGE_EXPORT vtkImageReader : public vtkImageReader2
45 {
46 public:
47  static vtkImageReader* New();
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52 
56  vtkSetVector6Macro(DataVOI, int);
57  vtkGetVector6Macro(DataVOI, int);
59 
61 
68  vtkGetMacro(DataMask, vtkTypeUInt64);
69  vtkSetMacro(DataMask, vtkTypeUInt64);
71 
73 
78  virtual void SetTransform(vtkTransform*);
79  vtkGetObjectMacro(Transform, vtkTransform);
81 
82  // Warning !!!
83  // following should only be used by methods or template helpers, not users
84  void ComputeInverseTransformedExtent(int inExtent[6], int outExtent[6]);
85  void ComputeInverseTransformedIncrements(vtkIdType inIncr[3], vtkIdType outIncr[3]);
86 
87  int OpenAndSeekFile(int extent[6], int slice);
88 
90 
93  vtkSetStringMacro(ScalarArrayName);
94  vtkGetStringMacro(ScalarArrayName);
96 
103  int CanReadFile(VTK_FILEPATH const char*) override
104  {
105  return 1; // I think I can read the file but I cannot prove it
106  }
107 
108 protected:
109  vtkImageReader();
110  ~vtkImageReader() override;
111 
112  vtkTypeUInt64 DataMask;
113 
115 
116  void ComputeTransformedSpacing(double Spacing[3]);
117  void ComputeTransformedOrigin(double origin[3]);
118  void ComputeTransformedExtent(int inExtent[6], int outExtent[6]);
119  void ComputeTransformedIncrements(vtkIdType inIncr[3], vtkIdType outIncr[3]);
120 
121  int DataVOI[6];
122 
124 
125  int RequestInformation(vtkInformation* request, vtkInformationVector** inputVector,
126  vtkInformationVector* outputVector) override;
127 
129 
130 private:
131  vtkImageReader(const vtkImageReader&) = delete;
132  void operator=(const vtkImageReader&) = delete;
133 };
134 
135 #endif
static vtkImageReader2 * New()
Store vtkAlgorithm input/output information.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
int vtkIdType
Definition: vtkType.h:332
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:39
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:65