Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vtkVolume16Reader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkVolume16Reader.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00053 #ifndef __vtkVolume16Reader_h
00054 #define __vtkVolume16Reader_h
00055 
00056 #include "vtkVolumeReader.h"
00057 
00058 class vtkTransform;
00059 class vtkUnsignedCharArray;
00060 class vtkUnsignedShortArray;
00061 
00062 #define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0
00063 #define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1
00064 
00065 class VTK_IO_EXPORT vtkVolume16Reader : public vtkVolumeReader
00066 {
00067 public:
00068   vtkTypeRevisionMacro(vtkVolume16Reader,vtkVolumeReader);
00069   void PrintSelf(ostream& os, vtkIndent indent);
00070 
00074   static vtkVolume16Reader *New();
00075 
00077 
00078   vtkSetVector2Macro(DataDimensions,int);
00079   vtkGetVectorMacro(DataDimensions,int,2);
00081 
00083 
00085   vtkSetMacro(DataMask,unsigned short);
00086   vtkGetMacro(DataMask,unsigned short);
00088 
00090 
00091   vtkSetMacro(HeaderSize,int);
00092   vtkGetMacro(HeaderSize,int);
00094 
00096 
00106   void SetDataByteOrderToBigEndian();
00107   void SetDataByteOrderToLittleEndian();
00108   int GetDataByteOrder();
00109   void SetDataByteOrder(int);
00110   const char *GetDataByteOrderAsString();
00112 
00114 
00115   vtkSetMacro(SwapBytes,int);
00116   vtkGetMacro(SwapBytes,int);
00117   vtkBooleanMacro(SwapBytes,int);
00119 
00121 
00124   virtual void SetTransform(vtkTransform*);
00125   vtkGetObjectMacro(Transform,vtkTransform);
00127 
00129   vtkImageData *GetImage(int ImageNumber);
00130 
00131 protected:
00132   vtkVolume16Reader();
00133   ~vtkVolume16Reader();
00134 
00135   virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00136   virtual int RequestInformation(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00137   int   DataDimensions[2];
00138   unsigned short DataMask;
00139   int   SwapBytes;
00140   int   HeaderSize;
00141   vtkTransform *Transform;
00142 
00143   void TransformSlice (unsigned short *slice, unsigned short *pixels, int k, int dimensions[3], int bounds[3]);
00144   void ComputeTransformedDimensions(int dimensions[3]);
00145   void ComputeTransformedBounds(int bounds[6]);
00146   void ComputeTransformedSpacing(double Spacing[3]);
00147   void ComputeTransformedOrigin(double origin[3]);
00148   void AdjustSpacingAndOrigin(int dimensions[3], double Spacing[3], double origin[3]);
00149   void ReadImage(int ImageNumber, vtkUnsignedShortArray *);
00150   void ReadVolume(int FirstImage, int LastImage, vtkUnsignedShortArray *);
00151   int Read16BitImage(FILE *fp, unsigned short *pixels, int xsize, int ysize, 
00152                      int skip, int swapBytes);
00153 
00154 private:
00155   vtkVolume16Reader(const vtkVolume16Reader&);  // Not implemented.
00156   void operator=(const vtkVolume16Reader&);  // Not implemented.
00157 };
00158 
00159 #endif
00160 
00161 

Generated on Mon Jan 21 23:07:32 2008 for VTK by  doxygen 1.4.3-20050530