VTK
dox/Rendering/Image/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 "vtkRenderingImageModule.h" // For export macro
00038 #include "vtkImageMapper3D.h"
00039 
00040 class vtkImageSliceMapper;
00041 class vtkRenderer;
00042 class vtkRenderWindow;
00043 class vtkCamera;
00044 class vtkLookupTable;
00045 class vtkImageSlice;
00046 class vtkImageData;
00047 class vtkImageResliceToColors;
00048 class vtkMatrix4x4;
00049 class vtkAbstractImageInterpolator;
00050 
00051 class VTKRENDERINGIMAGE_EXPORT vtkImageResliceMapper : public vtkImageMapper3D
00052 {
00053 public:
00054   static vtkImageResliceMapper *New();
00055   vtkTypeMacro(vtkImageResliceMapper,vtkImageMapper3D);
00056   void PrintSelf(ostream& os, vtkIndent indent);
00057 
00062   virtual void SetSlicePlane(vtkPlane *plane);
00063 
00065 
00069   vtkSetMacro(JumpToNearestSlice, int);
00070   vtkBooleanMacro(JumpToNearestSlice, int);
00071   vtkGetMacro(JumpToNearestSlice, int);
00073 
00075 
00076   vtkSetMacro(SlabThickness, double);
00077   vtkGetMacro(SlabThickness, double);
00079 
00081 
00082   vtkSetClampMacro(SlabType, int, VTK_IMAGE_SLAB_MIN, VTK_IMAGE_SLAB_MEAN);
00083   vtkGetMacro(SlabType, int);
00084   void SetSlabTypeToMin() {
00085     this->SetSlabType(VTK_IMAGE_SLAB_MIN); };
00086   void SetSlabTypeToMax() {
00087     this->SetSlabType(VTK_IMAGE_SLAB_MAX); };
00088   void SetSlabTypeToMean() {
00089     this->SetSlabType(VTK_IMAGE_SLAB_MEAN); };
00090   virtual const char *GetSlabTypeAsString();
00092 
00094 
00097   vtkSetClampMacro(SlabSampleFactor, int, 1, 2);
00098   vtkGetMacro(SlabSampleFactor, int);
00100 
00102 
00106   vtkSetClampMacro(ImageSampleFactor, int, 1, 16);
00107   vtkGetMacro(ImageSampleFactor, int);
00109 
00111 
00113   vtkSetMacro(AutoAdjustImageQuality, int);
00114   vtkBooleanMacro(AutoAdjustImageQuality, int);
00115   vtkGetMacro(AutoAdjustImageQuality, int);
00117 
00119 
00122   vtkSetMacro(ResampleToScreenPixels, int);
00123   vtkBooleanMacro(ResampleToScreenPixels, int);
00124   vtkGetMacro(ResampleToScreenPixels, int);
00126 
00128 
00132   vtkSetMacro(SeparateWindowLevelOperation, int);
00133   vtkBooleanMacro(SeparateWindowLevelOperation, int);
00134   vtkGetMacro(SeparateWindowLevelOperation, int);
00136 
00138 
00140   virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler);
00141   virtual vtkAbstractImageInterpolator *GetInterpolator();
00143 
00145   virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop);
00146 
00150   virtual void ReleaseGraphicsResources(vtkWindow *);
00151 
00153   unsigned long GetMTime();
00154 
00156 
00158   double *GetBounds();
00159   void GetBounds(double bounds[6])
00160     { this->vtkAbstractMapper3D::GetBounds(bounds); };
00162 
00164 
00165   int ProcessRequest(vtkInformation* request,
00166                      vtkInformationVector** inInfo,
00167                      vtkInformationVector* outInfo);
00169 
00170 protected:
00171   vtkImageResliceMapper();
00172   ~vtkImageResliceMapper();
00173 
00175 
00176   void CheckerboardImage(
00177     vtkImageData *input, vtkCamera *camera, vtkImageProperty *property);
00179 
00181   void UpdateSliceToWorldMatrix(vtkCamera *camera);
00182 
00185   void UpdateWorldToDataMatrix(vtkImageSlice *prop);
00186 
00188   void UpdateResliceMatrix(vtkRenderer *ren, vtkImageSlice *prop);
00189 
00192   void UpdateResliceInformation(vtkRenderer *ren);
00193 
00195   void UpdateResliceInterpolation(vtkImageProperty *property);
00196 
00198   void UpdateColorInformation(vtkImageProperty *property);
00199 
00201   void UpdatePolygonCoords(vtkRenderer *ren);
00202 
00204 
00205   void Update();
00206   void Update(int port);
00208 
00210   void ReportReferences(vtkGarbageCollector*);
00211 
00212   vtkImageSliceMapper *SliceMapper; // Does the OpenGL rendering
00213 
00214   int JumpToNearestSlice; // Adjust SliceAtFocalPoint
00215   int AutoAdjustImageQuality; // LOD-style behavior
00216   int SeparateWindowLevelOperation; // Do window/level as a separate step
00217   double SlabThickness; // Current slab thickness
00218   int SlabType; // Current slab mode
00219   int SlabSampleFactor; // Sampling factor for slab mode
00220   int ImageSampleFactor; // Sampling factor for image pixels
00221   int ResampleToScreenPixels; // Use software interpolation only
00222   int InternalResampleToScreenPixels; // Use software interpolation only
00223   int ResliceNeedUpdate; // Execute reslice on next render
00224   vtkImageResliceToColors *ImageReslice; // For software interpolation
00225   vtkMatrix4x4 *ResliceMatrix; // Cached reslice matrix
00226   vtkMatrix4x4 *WorldToDataMatrix; // World to Data transform matrix
00227   vtkMatrix4x4 *SliceToWorldMatrix; // Slice to World transform matrix
00228   vtkTimeStamp UpdateTime;
00229 
00230 private:
00231   vtkImageResliceMapper(const vtkImageResliceMapper&);  // Not implemented.
00232   void operator=(const vtkImageResliceMapper&);  // Not implemented.
00233 };
00234 
00235 #endif