IO/vtkVolume16Reader.h Source File

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# IO/vtkVolume16Reader.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program:   Visualization Toolkit
    00004   Module:    $RCSfile: vtkVolume16Reader.h,v $
    00005   Language:  C++
    00006
    00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
    00008   All rights reserved.
    00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
    00010
    00011      This software is distributed WITHOUT ANY WARRANTY; without even
    00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00013      PURPOSE.  See the above copyright notice for more information.
    00014
    00015 =========================================================================*/
    00069 #ifndef __vtkVolume16Reader_h
    00070 #define __vtkVolume16Reader_h
    00071
    00072 #include "vtkVolumeReader.h"
    00073
    00074 class vtkTransform;
    00075 class vtkUnsignedCharArray;
    00076 class vtkUnsignedShortArray;
    00077
    00078 #define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0
    00079 #define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1
    00080
    00081 class VTK_IO_EXPORT vtkVolume16Reader : public vtkVolumeReader
    00082 {
    00083 public:
    00084   vtkTypeRevisionMacro(vtkVolume16Reader,vtkVolumeReader);
    00085   void PrintSelf(ostream& os, vtkIndent indent);
    00086
    00090   static vtkVolume16Reader *New();
    00091
    00093
    00094   vtkSetVector2Macro(DataDimensions,int);
    00095   vtkGetVectorMacro(DataDimensions,int,2);
    00097
    00099
    00101   vtkSetMacro(DataMask,unsigned short);
    00102   vtkGetMacro(DataMask,unsigned short);
    00104
    00106
    00107   vtkSetMacro(HeaderSize,int);
    00108   vtkGetMacro(HeaderSize,int);
    00110
    00112
    00122   void SetDataByteOrderToBigEndian();
    00123   void SetDataByteOrderToLittleEndian();
    00124   int GetDataByteOrder();
    00125   void SetDataByteOrder(int);
    00126   const char *GetDataByteOrderAsString();
    00128
    00130
    00131   vtkSetMacro(SwapBytes,int);
    00132   vtkGetMacro(SwapBytes,int);
    00133   vtkBooleanMacro(SwapBytes,int);
    00135
    00137
    00140   virtual void SetTransform(vtkTransform*);
    00141   vtkGetObjectMacro(Transform,vtkTransform);
    00143
    00145   vtkImageData *GetImage(int ImageNumber);
    00146
    00147 protected:
    00148   vtkVolume16Reader();
    00149   ~vtkVolume16Reader();
    00150
    00151   virtual void ExecuteData(vtkDataObject *);
    00152   virtual void ExecuteInformation();
    00153   int   DataDimensions[2];
    00154   unsigned short DataMask;
    00155   int   SwapBytes;
    00156   int   HeaderSize;
    00157   vtkTransform *Transform;
    00158
    00159   void TransformSlice (unsigned short *slice, unsigned short *pixels, int k, int dimensions[3], int bounds[3]);
    00160   void ComputeTransformedDimensions(int dimensions[3]);
    00161   void ComputeTransformedBounds(int bounds[6]);
    00162   void ComputeTransformedSpacing(float Spacing[3]);
    00163   void ComputeTransformedOrigin(float origin[3]);
    00164   void AdjustSpacingAndOrigin(int dimensions[3], float Spacing[3], float origin[3]);
    00165   void ReadImage(int ImageNumber, vtkUnsignedShortArray *);
    00166   void ReadVolume(int FirstImage, int LastImage, vtkUnsignedShortArray *);
    00167   int Read16BitImage(FILE *fp, unsigned short *pixels, int xsize, int ysize,
    00168                      int skip, int swapBytes);
    00169
    00170 private:
    00171   vtkVolume16Reader(const vtkVolume16Reader&);  // Not implemented.
    00172   void operator=(const vtkVolume16Reader&);  // Not implemented.
    00173 };
    00174
    00175 #endif
    00176
    00177