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

IO/vtkImageReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageReader.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 =========================================================================*/
00048 #ifndef __vtkImageReader_h
00049 #define __vtkImageReader_h
00050 
00051 #include "vtkImageReader2.h"
00052 
00053 class vtkTransform;
00054 
00055 #define VTK_FILE_BYTE_ORDER_BIG_ENDIAN 0
00056 #define VTK_FILE_BYTE_ORDER_LITTLE_ENDIAN 1
00057 
00058 class VTK_IO_EXPORT vtkImageReader : public vtkImageReader2
00059 {
00060 public:
00061   static vtkImageReader *New();
00062   vtkTypeRevisionMacro(vtkImageReader,vtkImageReader2);
00063   void PrintSelf(ostream& os, vtkIndent indent);   
00064 
00066 
00068   vtkSetVector6Macro(DataVOI,int);
00069   vtkGetVector6Macro(DataVOI,int);
00071   
00073 
00074   vtkGetMacro(DataMask,unsigned short);
00075   void SetDataMask(int val) 
00076        {if (val == this->DataMask) { return; }
00077         this->DataMask = ((unsigned short)(val)); this->Modified();}
00079   
00081 
00084   virtual void SetTransform(vtkTransform*);
00085   vtkGetObjectMacro(Transform,vtkTransform);
00087 
00088   // Warning !!!
00089   // following should only be used by methods or template helpers, not users
00090   void ComputeInverseTransformedExtent(int inExtent[6],
00091                                        int outExtent[6]);
00092   void ComputeInverseTransformedIncrements(int inIncr[3],
00093                                            int outIncr[3]);
00094 
00095   int OpenAndSeekFile(int extent[6], int slice);
00096 protected:
00097   vtkImageReader();
00098   ~vtkImageReader();
00099 
00100   unsigned short DataMask;  // Mask each pixel with ...
00101 
00102   vtkTransform *Transform;
00103 
00104   void ComputeTransformedSpacing (float Spacing[3]);
00105   void ComputeTransformedOrigin (float origin[3]);
00106   void ComputeTransformedExtent(int inExtent[6],
00107                                 int outExtent[6]);
00108   void ComputeTransformedIncrements(int inIncr[3],
00109                                     int outIncr[3]);
00110 
00111   int DataVOI[6];
00112   
00113   void ExecuteInformation();
00114   void ExecuteData(vtkDataObject *data);
00115 private:
00116   vtkImageReader(const vtkImageReader&);  // Not implemented.
00117   void operator=(const vtkImageReader&);  // Not implemented.
00118 };
00119 
00120 #endif