VTK
|
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 00088 vtkSetClampMacro(SlabType, int, VTK_IMAGE_SLAB_MIN, VTK_IMAGE_SLAB_SUM); 00089 vtkGetMacro(SlabType, int); 00090 void SetSlabTypeToMin() { 00091 this->SetSlabType(VTK_IMAGE_SLAB_MIN); }; 00092 void SetSlabTypeToMax() { 00093 this->SetSlabType(VTK_IMAGE_SLAB_MAX); }; 00094 void SetSlabTypeToMean() { 00095 this->SetSlabType(VTK_IMAGE_SLAB_MEAN); }; 00096 void SetSlabTypeToSum() { 00097 this->SetSlabType(VTK_IMAGE_SLAB_SUM); }; 00098 virtual const char *GetSlabTypeAsString(); 00100 00102 00105 vtkSetClampMacro(SlabSampleFactor, int, 1, 2); 00106 vtkGetMacro(SlabSampleFactor, int); 00108 00110 00114 vtkSetClampMacro(ImageSampleFactor, int, 1, 16); 00115 vtkGetMacro(ImageSampleFactor, int); 00117 00119 00121 vtkSetMacro(AutoAdjustImageQuality, int); 00122 vtkBooleanMacro(AutoAdjustImageQuality, int); 00123 vtkGetMacro(AutoAdjustImageQuality, int); 00125 00127 00130 vtkSetMacro(ResampleToScreenPixels, int); 00131 vtkBooleanMacro(ResampleToScreenPixels, int); 00132 vtkGetMacro(ResampleToScreenPixels, int); 00134 00136 00140 vtkSetMacro(SeparateWindowLevelOperation, int); 00141 vtkBooleanMacro(SeparateWindowLevelOperation, int); 00142 vtkGetMacro(SeparateWindowLevelOperation, int); 00144 00146 00148 virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler); 00149 virtual vtkAbstractImageInterpolator *GetInterpolator(); 00151 00153 virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop); 00154 00158 virtual void ReleaseGraphicsResources(vtkWindow *); 00159 00161 unsigned long GetMTime(); 00162 00164 00166 double *GetBounds(); 00167 void GetBounds(double bounds[6]) 00168 { this->vtkAbstractMapper3D::GetBounds(bounds); }; 00170 00172 00173 int ProcessRequest(vtkInformation* request, 00174 vtkInformationVector** inInfo, 00175 vtkInformationVector* outInfo); 00177 00178 protected: 00179 vtkImageResliceMapper(); 00180 ~vtkImageResliceMapper(); 00181 00183 00184 void CheckerboardImage( 00185 vtkImageData *input, vtkCamera *camera, vtkImageProperty *property); 00187 00189 void UpdateSliceToWorldMatrix(vtkCamera *camera); 00190 00193 void UpdateWorldToDataMatrix(vtkImageSlice *prop); 00194 00196 void UpdateResliceMatrix(vtkRenderer *ren, vtkImageSlice *prop); 00197 00200 void UpdateResliceInformation(vtkRenderer *ren); 00201 00203 void UpdateResliceInterpolation(vtkImageProperty *property); 00204 00206 void UpdateColorInformation(vtkImageProperty *property); 00207 00209 void UpdatePolygonCoords(vtkRenderer *ren); 00210 00212 00213 void Update(); 00214 void Update(int port); 00216 00218 void ReportReferences(vtkGarbageCollector*); 00219 00220 vtkImageSliceMapper *SliceMapper; // Does the OpenGL rendering 00221 00222 int JumpToNearestSlice; // Adjust SliceAtFocalPoint 00223 int AutoAdjustImageQuality; // LOD-style behavior 00224 int SeparateWindowLevelOperation; // Do window/level as a separate step 00225 double SlabThickness; // Current slab thickness 00226 int SlabType; // Current slab mode 00227 int SlabSampleFactor; // Sampling factor for slab mode 00228 int ImageSampleFactor; // Sampling factor for image pixels 00229 int ResampleToScreenPixels; // Use software interpolation only 00230 int InternalResampleToScreenPixels; // Use software interpolation only 00231 int ResliceNeedUpdate; // Execute reslice on next render 00232 vtkImageResliceToColors *ImageReslice; // For software interpolation 00233 vtkMatrix4x4 *ResliceMatrix; // Cached reslice matrix 00234 vtkMatrix4x4 *WorldToDataMatrix; // World to Data transform matrix 00235 vtkMatrix4x4 *SliceToWorldMatrix; // Slice to World transform matrix 00236 vtkTimeStamp UpdateTime; 00237 00238 private: 00239 vtkImageResliceMapper(const vtkImageResliceMapper&); // Not implemented. 00240 void operator=(const vtkImageResliceMapper&); // Not implemented. 00241 }; 00242 00243 #endif