VTK: IO/Image/vtkVolume16Reader.h Source File

| VTK 9.3.1

vtkVolume16Reader.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
42 #ifndef vtkVolume16Reader_h
43 #define vtkVolume16Reader_h
44
45 #include "vtkIOImageModule.h" // For export macro
46 #include "vtkVolumeReader.h"
47
48 VTK_ABI_NAMESPACE_BEGIN
49 class vtkTransform;
50 class vtkUnsignedCharArray;
51 class vtkUnsignedShortArray;
52
53 #define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0
54 #define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1
55
56 class VTKIOIMAGE_EXPORT vtkVolume16Reader : public vtkVolumeReader
57 {
58 public:
59 vtkTypeMacro(vtkVolume16Reader, vtkVolumeReader);
60 void PrintSelf(ostream& os, vtkIndent indent) override;
61
67 static vtkVolume16Reader* New();
68
70
73 vtkSetVector2Macro(DataDimensions, int);
74 vtkGetVectorMacro(DataDimensions, int, 2);
76
78
82 vtkSetMacro(DataMask, unsigned short);
83 vtkGetMacro(DataMask, unsigned short);
85
87
90 vtkSetMacro(HeaderSize, int);
91 vtkGetMacro(HeaderSize, int);
93
95
108 void SetDataByteOrderToBigEndian();
109 void SetDataByteOrderToLittleEndian();
110 int GetDataByteOrder();
111 void SetDataByteOrder(int);
112 const char* GetDataByteOrderAsString();
114
116
119 vtkSetMacro(SwapBytes, vtkTypeBool);
120 vtkGetMacro(SwapBytes, vtkTypeBool);
121 vtkBooleanMacro(SwapBytes, vtkTypeBool);
123
125
130 virtual void SetTransform(vtkTransform*);
131 vtkGetObjectMacro(Transform, vtkTransform);
133
137 vtkImageData* GetImage(int ImageNumber) override;
138
139 protected:
140 vtkVolume16Reader();
141 ~vtkVolume16Reader() override;
142
143 int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
144 int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
145 int DataDimensions[2];
146 unsigned short DataMask;
147 vtkTypeBool SwapBytes;
148 int HeaderSize;
149 vtkTransform* Transform;
150
151 void TransformSlice(
152 unsigned short* slice, unsigned short* pixels, int k, int dimensions[3], int bounds[6]);
153 void ComputeTransformedDimensions(int dimensions[3]);
154 void ComputeTransformedBounds(int bounds[6]);
155 void ComputeTransformedSpacing(double Spacing[3]);
156 void ComputeTransformedOrigin(double origin[3]);
157 void AdjustSpacingAndOrigin(int dimensions[3], double Spacing[3], double origin[3]);
158 void ReadImage(int ImageNumber, vtkUnsignedShortArray*);
159 void ReadVolume(int FirstImage, int LastImage, vtkUnsignedShortArray*);
160 int Read16BitImage(
161 FILE* fp, unsigned short* pixels, int xsize, int ysize, int skip, int swapBytes);
162
163 private:
164 vtkVolume16Reader(const vtkVolume16Reader&) = delete;
165 void operator=(const vtkVolume16Reader&) = delete;
166 };
167
168 VTK_ABI_NAMESPACE_END
169 #endif
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:40
vtkUnsignedShortArray
dynamic, self-adjusting array of unsigned short
Definition: vtkUnsignedShortArray.h:32
vtkVolume16Reader
read 16 bit image files
Definition: vtkVolume16Reader.h:57
vtkVolume16Reader::ReadImage
void ReadImage(int ImageNumber, vtkUnsignedShortArray *)
vtkVolume16Reader::New
static vtkVolume16Reader * New()
Construct object with nullptr file prefix; file pattern "%s.%d"; image range set to (1,...
vtkVolume16Reader::AdjustSpacingAndOrigin
void AdjustSpacingAndOrigin(int dimensions[3], double Spacing[3], double origin[3])
vtkVolume16Reader::ComputeTransformedSpacing
void ComputeTransformedSpacing(double Spacing[3])
vtkVolume16Reader::SetDataByteOrder
void SetDataByteOrder(int)
These methods should be used instead of the SwapBytes methods.
vtkVolume16Reader::SetTransform
virtual void SetTransform(vtkTransform *)
Set/Get transformation matrix to transform the data from slice space into world space.
vtkVolume16Reader::GetDataByteOrder
int GetDataByteOrder()
These methods should be used instead of the SwapBytes methods.
vtkVolume16Reader::Transform
vtkTransform * Transform
Definition: vtkVolume16Reader.h:149
vtkVolume16Reader::HeaderSize
int HeaderSize
Definition: vtkVolume16Reader.h:148
vtkVolume16Reader::~vtkVolume16Reader
~vtkVolume16Reader() override
vtkVolume16Reader::ComputeTransformedDimensions
void ComputeTransformedDimensions(int dimensions[3])
vtkVolume16Reader::SwapBytes
vtkTypeBool SwapBytes
Definition: vtkVolume16Reader.h:147
vtkVolume16Reader::GetDataByteOrderAsString
const char * GetDataByteOrderAsString()
These methods should be used instead of the SwapBytes methods.
vtkVolume16Reader::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkVolume16Reader::Read16BitImage
int Read16BitImage(FILE *fp, unsigned short *pixels, int xsize, int ysize, int skip, int swapBytes)
vtkVolume16Reader::vtkVolume16Reader
vtkVolume16Reader()
vtkVolume16Reader::SetDataByteOrderToLittleEndian
void SetDataByteOrderToLittleEndian()
These methods should be used instead of the SwapBytes methods.
vtkVolume16Reader::RequestInformation
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
vtkVolume16Reader::ComputeTransformedBounds
void ComputeTransformedBounds(int bounds[6])
vtkVolume16Reader::GetImage
vtkImageData * GetImage(int ImageNumber) override
Other objects make use of these methods.
vtkVolume16Reader::ReadVolume
void ReadVolume(int FirstImage, int LastImage, vtkUnsignedShortArray *)
vtkVolume16Reader::DataMask
unsigned short DataMask
Definition: vtkVolume16Reader.h:146
vtkVolume16Reader::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called in response to a REQUEST_DATA request from the executive.
vtkVolume16Reader::ComputeTransformedOrigin
void ComputeTransformedOrigin(double origin[3])
vtkVolume16Reader::SetDataByteOrderToBigEndian
void SetDataByteOrderToBigEndian()
These methods should be used instead of the SwapBytes methods.
vtkVolume16Reader::TransformSlice
void TransformSlice(unsigned short *slice, unsigned short *pixels, int k, int dimensions[3], int bounds[6])
vtkVolumeReader
read image files
Definition: vtkVolumeReader.h:41
vtkX3D::Transform
@ Transform
Definition: vtkX3D.h:41
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkVolumeReader.h