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

vtkImageReader.h

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