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 =========================================================================*/
53 #ifndef __vtkVolume16Reader_h
54 #define __vtkVolume16Reader_h
55 
56 #include "vtkVolumeReader.h"
57 
58 class vtkTransform;
61 
62 #define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0
63 #define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1
64 
66 {
67 public:
69  void PrintSelf(ostream& os, vtkIndent indent);
70 
74  static vtkVolume16Reader *New();
75 
77 
78  vtkSetVector2Macro(DataDimensions,int);
79  vtkGetVectorMacro(DataDimensions,int,2);
81 
83 
85  vtkSetMacro(DataMask,unsigned short);
86  vtkGetMacro(DataMask,unsigned short);
88 
90 
91  vtkSetMacro(HeaderSize,int);
92  vtkGetMacro(HeaderSize,int);
94 
96 
106  void SetDataByteOrderToBigEndian();
107  void SetDataByteOrderToLittleEndian();
108  int GetDataByteOrder();
109  void SetDataByteOrder(int);
110  const char *GetDataByteOrderAsString();
112 
114 
115  vtkSetMacro(SwapBytes,int);
116  vtkGetMacro(SwapBytes,int);
117  vtkBooleanMacro(SwapBytes,int);
119 
121 
124  virtual void SetTransform(vtkTransform*);
125  vtkGetObjectMacro(Transform,vtkTransform);
127 
129  vtkImageData *GetImage(int ImageNumber);
130 
131 protected:
134 
137  int DataDimensions[2];
138  unsigned short DataMask;
142 
143  void TransformSlice (unsigned short *slice, unsigned short *pixels, int k, int dimensions[3], int bounds[3]);
144  void ComputeTransformedDimensions(int dimensions[3]);
145  void ComputeTransformedBounds(int bounds[6]);
146  void ComputeTransformedSpacing(double Spacing[3]);
147  void ComputeTransformedOrigin(double origin[3]);
148  void AdjustSpacingAndOrigin(int dimensions[3], double Spacing[3], double origin[3]);
149  void ReadImage(int ImageNumber, vtkUnsignedShortArray *);
150  void ReadVolume(int FirstImage, int LastImage, vtkUnsignedShortArray *);
151  int Read16BitImage(FILE *fp, unsigned short *pixels, int xsize, int ysize,
152  int skip, int swapBytes);
153 
154 private:
155  vtkVolume16Reader(const vtkVolume16Reader&); // Not implemented.
156  void operator=(const vtkVolume16Reader&); // Not implemented.
157 };
158 
159 #endif
160 
161 
read image files
Store vtkAlgorithm input/output information.
virtual vtkImageData * GetImage(int ImageNumber)=0
vtkTransform * Transform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:58
a simple class to control print indentation
Definition: vtkIndent.h:37
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
virtual int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
read 16 bit image files
dynamic, self-adjusting array of unsigned char
unsigned short DataMask
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()
#define VTK_IO_EXPORT
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void PrintSelf(ostream &os, vtkIndent indent)
dynamic, self-adjusting array of unsigned short