VTK  9.2.6
vtkVolume16Reader.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkVolume16Reader.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=========================================================================*/
54#ifndef vtkVolume16Reader_h
55#define vtkVolume16Reader_h
56
57#include "vtkIOImageModule.h" // For export macro
58#include "vtkVolumeReader.h"
59
60class vtkTransform;
63
64#define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0
65#define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1
66
67class VTKIOIMAGE_EXPORT vtkVolume16Reader : public vtkVolumeReader
68{
69public:
71 void PrintSelf(ostream& os, vtkIndent indent) override;
72
79
81
84 vtkSetVector2Macro(DataDimensions, int);
85 vtkGetVectorMacro(DataDimensions, int, 2);
87
89
93 vtkSetMacro(DataMask, unsigned short);
94 vtkGetMacro(DataMask, unsigned short);
96
98
101 vtkSetMacro(HeaderSize, int);
102 vtkGetMacro(HeaderSize, int);
104
106
125
127
130 vtkSetMacro(SwapBytes, vtkTypeBool);
131 vtkGetMacro(SwapBytes, vtkTypeBool);
132 vtkBooleanMacro(SwapBytes, vtkTypeBool);
134
136
142 vtkGetObjectMacro(Transform, vtkTransform);
144
148 vtkImageData* GetImage(int ImageNumber) override;
149
150protected:
153
156 int DataDimensions[2];
157 unsigned short DataMask;
161
163 unsigned short* slice, unsigned short* pixels, int k, int dimensions[3], int bounds[3]);
164 void ComputeTransformedDimensions(int dimensions[3]);
165 void ComputeTransformedBounds(int bounds[6]);
166 void ComputeTransformedSpacing(double Spacing[3]);
167 void ComputeTransformedOrigin(double origin[3]);
168 void AdjustSpacingAndOrigin(int dimensions[3], double Spacing[3], double origin[3]);
169 void ReadImage(int ImageNumber, vtkUnsignedShortArray*);
170 void ReadVolume(int FirstImage, int LastImage, vtkUnsignedShortArray*);
172 FILE* fp, unsigned short* pixels, int xsize, int ysize, int skip, int swapBytes);
173
174private:
175 vtkVolume16Reader(const vtkVolume16Reader&) = delete;
176 void operator=(const vtkVolume16Reader&) = delete;
177};
178
179#endif
topologically and geometrically regular array of data
Definition: vtkImageData.h:54
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:61
dynamic, self-adjusting array of unsigned char
dynamic, self-adjusting array of unsigned short
read 16 bit image files
void ReadImage(int ImageNumber, vtkUnsignedShortArray *)
void AdjustSpacingAndOrigin(int dimensions[3], double Spacing[3], double origin[3])
void ComputeTransformedSpacing(double Spacing[3])
static vtkVolume16Reader * New()
Construct object with nullptr file prefix; file pattern "%s.%d"; image range set to (1,...
void SetDataByteOrder(int)
These methods should be used instead of the SwapBytes methods.
virtual void SetTransform(vtkTransform *)
Set/Get transformation matrix to transform the data from slice space into world space.
int GetDataByteOrder()
These methods should be used instead of the SwapBytes methods.
vtkTransform * Transform
~vtkVolume16Reader() override
void TransformSlice(unsigned short *slice, unsigned short *pixels, int k, int dimensions[3], int bounds[3])
void ComputeTransformedDimensions(int dimensions[3])
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int Read16BitImage(FILE *fp, unsigned short *pixels, int xsize, int ysize, int skip, int swapBytes)
void SetDataByteOrderToLittleEndian()
These methods should be used instead of the SwapBytes methods.
int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses can reimplement this method to collect information from their inputs and set information f...
void ComputeTransformedBounds(int bounds[6])
vtkImageData * GetImage(int ImageNumber) override
Other objects make use of these methods.
void ReadVolume(int FirstImage, int LastImage, vtkUnsignedShortArray *)
unsigned short DataMask
const char * GetDataByteOrderAsString()
These methods should be used instead of the SwapBytes methods.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called in response to a REQUEST_DATA request from the executive.
void ComputeTransformedOrigin(double origin[3])
void SetDataByteOrderToBigEndian()
These methods should be used instead of the SwapBytes methods.
read image files
int vtkTypeBool
Definition: vtkABI.h:69