VTK
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 =========================================================================*/
48 #ifndef vtkVolume16Reader_h
49 #define vtkVolume16Reader_h
50 
51 #include "vtkIOImageModule.h" // For export macro
52 #include "vtkVolumeReader.h"
53 
54 class vtkTransform;
57 
58 #define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0
59 #define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1
60 
61 class VTKIOIMAGE_EXPORT vtkVolume16Reader : public vtkVolumeReader
62 {
63 public:
65  void PrintSelf(ostream& os, vtkIndent indent) override;
66 
72  static vtkVolume16Reader *New();
73 
75 
78  vtkSetVector2Macro(DataDimensions,int);
79  vtkGetVectorMacro(DataDimensions,int,2);
81 
83 
87  vtkSetMacro(DataMask,unsigned short);
88  vtkGetMacro(DataMask,unsigned short);
90 
92 
95  vtkSetMacro(HeaderSize,int);
96  vtkGetMacro(HeaderSize,int);
98 
100 
113  void SetDataByteOrderToBigEndian();
114  void SetDataByteOrderToLittleEndian();
115  int GetDataByteOrder();
116  void SetDataByteOrder(int);
117  const char *GetDataByteOrderAsString();
119 
121 
124  vtkSetMacro(SwapBytes,vtkTypeBool);
125  vtkGetMacro(SwapBytes,vtkTypeBool);
126  vtkBooleanMacro(SwapBytes,vtkTypeBool);
128 
130 
135  virtual void SetTransform(vtkTransform*);
136  vtkGetObjectMacro(Transform,vtkTransform);
138 
142  vtkImageData *GetImage(int ImageNumber) override;
143 
144 protected:
146  ~vtkVolume16Reader() override;
147 
150  int DataDimensions[2];
151  unsigned short DataMask;
155 
156  void TransformSlice (unsigned short *slice, unsigned short *pixels, int k, int dimensions[3], int bounds[3]);
157  void ComputeTransformedDimensions(int dimensions[3]);
158  void ComputeTransformedBounds(int bounds[6]);
159  void ComputeTransformedSpacing(double Spacing[3]);
160  void ComputeTransformedOrigin(double origin[3]);
161  void AdjustSpacingAndOrigin(int dimensions[3], double Spacing[3], double origin[3]);
162  void ReadImage(int ImageNumber, vtkUnsignedShortArray *);
163  void ReadVolume(int FirstImage, int LastImage, vtkUnsignedShortArray *);
164  int Read16BitImage(FILE *fp, unsigned short *pixels, int xsize, int ysize,
165  int skip, int swapBytes);
166 
167 private:
168  vtkVolume16Reader(const vtkVolume16Reader&) = delete;
169  void operator=(const vtkVolume16Reader&) = delete;
170 };
171 
172 #endif
173 
174 
read image files
Store vtkAlgorithm input/output information.
virtual vtkImageData * GetImage(int ImageNumber)=0
Other objects make use of this method.
vtkTransform * Transform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:54
int vtkTypeBool
Definition: vtkABI.h:69
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
Subclasses can reimplement this method to collect information from their inputs and set information f...
read 16 bit image files
dynamic, self-adjusting array of unsigned char
unsigned short DataMask
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called in response to a REQUEST_DATA request from the executive.
dynamic, self-adjusting array of unsigned short
Transform
Definition: ADIOSDefs.h:40