VTK
dox/Rendering/vtkImageResliceMapper.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImageResliceMapper.h
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 =========================================================================*/
00034 #ifndef __vtkImageResliceMapper_h
00035 #define __vtkImageResliceMapper_h
00036 
00037 #include "vtkImageMapper3D.h"
00038 
00039 class vtkImageSliceMapper;
00040 class vtkRenderer;
00041 class vtkRenderWindow;
00042 class vtkCamera;
00043 class vtkLookupTable;
00044 class vtkImageSlice;
00045 class vtkImageData;
00046 class vtkImageResliceToColors;
00047 class vtkMatrix4x4;
00048 class vtkAbstractImageInterpolator;
00049 
00050 class VTK_RENDERING_EXPORT vtkImageResliceMapper : public vtkImageMapper3D
00051 {
00052 public:
00053   static vtkImageResliceMapper *New();
00054   vtkTypeMacro(vtkImageResliceMapper,vtkImageMapper3D);
00055   void PrintSelf(ostream& os, vtkIndent indent);
00056 
00061   virtual void SetSlicePlane(vtkPlane *plane);
00062 
00064 
00068   vtkSetMacro(JumpToNearestSlice, int);
00069   vtkBooleanMacro(JumpToNearestSlice, int);
00070   vtkGetMacro(JumpToNearestSlice, int);
00072 
00074 
00075   vtkSetMacro(SlabThickness, double);
00076   vtkGetMacro(SlabThickness, double);
00078 
00080 
00081   vtkSetClampMacro(SlabType, int, VTK_IMAGE_SLAB_MIN, VTK_IMAGE_SLAB_MEAN);
00082   vtkGetMacro(SlabType, int);
00083   void SetSlabTypeToMin() {
00084     this->SetSlabType(VTK_IMAGE_SLAB_MIN); };
00085   void SetSlabTypeToMax() {
00086     this->SetSlabType(VTK_IMAGE_SLAB_MAX); };
00087   void SetSlabTypeToMean() {
00088     this->SetSlabType(VTK_IMAGE_SLAB_MEAN); };
00089   virtual const char *GetSlabTypeAsString();
00091 
00093 
00096   vtkSetClampMacro(SlabSampleFactor, int, 1, 2);
00097   vtkGetMacro(SlabSampleFactor, int);
00099 
00101 
00105   vtkSetClampMacro(ImageSampleFactor, int, 1, 16);
00106   vtkGetMacro(ImageSampleFactor, int);
00108 
00110 
00112   vtkSetMacro(AutoAdjustImageQuality, int);
00113   vtkBooleanMacro(AutoAdjustImageQuality, int);
00114   vtkGetMacro(AutoAdjustImageQuality, int);
00116 
00118 
00121   vtkSetMacro(ResampleToScreenPixels, int);
00122   vtkBooleanMacro(ResampleToScreenPixels, int);
00123   vtkGetMacro(ResampleToScreenPixels, int);
00125 
00127 
00131   vtkSetMacro(SeparateWindowLevelOperation, int);
00132   vtkBooleanMacro(SeparateWindowLevelOperation, int);
00133   vtkGetMacro(SeparateWindowLevelOperation, int);
00135 
00137 
00139   virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler);
00140   virtual vtkAbstractImageInterpolator *GetInterpolator();
00142 
00144   virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop);
00145 
00149   virtual void ReleaseGraphicsResources(vtkWindow *);
00150 
00152   unsigned long GetMTime();
00153 
00155 
00157   double *GetBounds();
00158   void GetBounds(double bounds[6])
00159     { this->vtkAbstractMapper3D::GetBounds(bounds); };
00161 
00163 
00164   int ProcessRequest(vtkInformation* request,
00165                      vtkInformationVector** inInfo,
00166                      vtkInformationVector* outInfo);
00168 
00169 protected:
00170   vtkImageResliceMapper();
00171   ~vtkImageResliceMapper();
00172 
00174 
00175   void CheckerboardImage(
00176     vtkImageData *input, vtkCamera *camera, vtkImageProperty *property);
00178 
00180   void UpdateSliceToWorldMatrix(vtkCamera *camera);
00181 
00184   void UpdateWorldToDataMatrix(vtkImageSlice *prop);
00185 
00187   void UpdateResliceMatrix(vtkRenderer *ren, vtkImageSlice *prop);
00188 
00191   void UpdateResliceInformation(vtkRenderer *ren);
00192 
00194   void UpdateResliceInterpolation(vtkImageProperty *property);
00195 
00197   void UpdateColorInformation(vtkImageProperty *property);
00198 
00200   void UpdatePolygonCoords(vtkRenderer *ren);
00201 
00203   void Update();
00204 
00206   void ReportReferences(vtkGarbageCollector*);
00207 
00208   vtkImageSliceMapper *SliceMapper; // Does the OpenGL rendering
00209 
00210   int JumpToNearestSlice; // Adjust SliceAtFocalPoint
00211   int AutoAdjustImageQuality; // LOD-style behavior
00212   int SeparateWindowLevelOperation; // Do window/level as a separate step
00213   double SlabThickness; // Current slab thickness
00214   int SlabType; // Current slab mode
00215   int SlabSampleFactor; // Sampling factor for slab mode
00216   int ImageSampleFactor; // Sampling factor for image pixels
00217   int ResampleToScreenPixels; // Use software interpolation only
00218   int InternalResampleToScreenPixels; // Use software interpolation only
00219   int ResliceNeedUpdate; // Execute reslice on next render
00220   vtkImageResliceToColors *ImageReslice; // For software interpolation
00221   vtkMatrix4x4 *ResliceMatrix; // Cached reslice matrix
00222   vtkMatrix4x4 *WorldToDataMatrix; // World to Data transform matrix
00223   vtkMatrix4x4 *SliceToWorldMatrix; // Slice to World transform matrix
00224   vtkTimeStamp UpdateTime;
00225 
00226 private:
00227   vtkImageResliceMapper(const vtkImageResliceMapper&);  // Not implemented.
00228   void operator=(const vtkImageResliceMapper&);  // Not implemented.
00229 };
00230 
00231 #endif