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 =========================================================================*/
54 #ifndef vtkVolume16Reader_h
55 #define vtkVolume16Reader_h
56 
57 #include "vtkIOImageModule.h" // For export macro
58 #include "vtkVolumeReader.h"
59 
60 class vtkTransform;
63 
64 #define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0
65 #define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1
66 
67 class VTKIOIMAGE_EXPORT vtkVolume16Reader : public vtkVolumeReader
68 {
69 public:
71  void PrintSelf(ostream& os, vtkIndent indent);
72 
78  static vtkVolume16Reader *New();
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 
119  void SetDataByteOrderToBigEndian();
120  void SetDataByteOrderToLittleEndian();
121  int GetDataByteOrder();
122  void SetDataByteOrder(int);
123  const char *GetDataByteOrderAsString();
125 
127 
130  vtkSetMacro(SwapBytes,int);
131  vtkGetMacro(SwapBytes,int);
132  vtkBooleanMacro(SwapBytes,int);
134 
136 
141  virtual void SetTransform(vtkTransform*);
142  vtkGetObjectMacro(Transform,vtkTransform);
144 
148  vtkImageData *GetImage(int ImageNumber);
149 
150 protected:
153 
156  int DataDimensions[2];
157  unsigned short DataMask;
161 
162  void TransformSlice (unsigned short *slice, unsigned short *pixels, int k, int dimensions[3], int bounds[3]);
163  void ComputeTransformedDimensions(int dimensions[3]);
164  void ComputeTransformedBounds(int bounds[6]);
165  void ComputeTransformedSpacing(double Spacing[3]);
166  void ComputeTransformedOrigin(double origin[3]);
167  void AdjustSpacingAndOrigin(int dimensions[3], double Spacing[3], double origin[3]);
168  void ReadImage(int ImageNumber, vtkUnsignedShortArray *);
169  void ReadVolume(int FirstImage, int LastImage, vtkUnsignedShortArray *);
170  int Read16BitImage(FILE *fp, unsigned short *pixels, int xsize, int ysize,
171  int skip, int swapBytes);
172 
173 private:
174  vtkVolume16Reader(const vtkVolume16Reader&) VTK_DELETE_FUNCTION;
175  void operator=(const vtkVolume16Reader&) VTK_DELETE_FUNCTION;
176 };
177 
178 #endif
179 
180 
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:60
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
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
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
dynamic, self-adjusting array of unsigned char
unsigned short DataMask
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called in response to a REQUEST_DATA request from the executive.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
dynamic, self-adjusting array of unsigned short
Transform
Definition: ADIOSDefs.h:39