VTK
vtkImageResliceMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageResliceMapper.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
35 #ifndef vtkImageResliceMapper_h
36 #define vtkImageResliceMapper_h
37 
38 #include "vtkRenderingImageModule.h" // For export macro
39 #include "vtkImageMapper3D.h"
40 
42 class vtkRenderer;
43 class vtkRenderWindow;
44 class vtkCamera;
45 class vtkLookupTable;
46 class vtkImageSlice;
47 class vtkImageData;
49 class vtkMatrix4x4;
51 
52 class VTKRENDERINGIMAGE_EXPORT vtkImageResliceMapper : public vtkImageMapper3D
53 {
54 public:
55  static vtkImageResliceMapper *New();
57  void PrintSelf(ostream& os, vtkIndent indent);
58 
65  virtual void SetSlicePlane(vtkPlane *plane);
66 
68 
74  vtkSetMacro(JumpToNearestSlice, int);
75  vtkBooleanMacro(JumpToNearestSlice, int);
76  vtkGetMacro(JumpToNearestSlice, int);
78 
80 
83  vtkSetMacro(SlabThickness, double);
84  vtkGetMacro(SlabThickness, double);
86 
88 
97  vtkSetClampMacro(SlabType, int, VTK_IMAGE_SLAB_MIN, VTK_IMAGE_SLAB_SUM);
98  vtkGetMacro(SlabType, int);
100  this->SetSlabType(VTK_IMAGE_SLAB_MIN); };
102  this->SetSlabType(VTK_IMAGE_SLAB_MAX); };
104  this->SetSlabType(VTK_IMAGE_SLAB_MEAN); };
106  this->SetSlabType(VTK_IMAGE_SLAB_SUM); };
107  virtual const char *GetSlabTypeAsString();
109 
111 
116  vtkSetClampMacro(SlabSampleFactor, int, 1, 2);
117  vtkGetMacro(SlabSampleFactor, int);
119 
121 
127  vtkSetClampMacro(ImageSampleFactor, int, 1, 16);
128  vtkGetMacro(ImageSampleFactor, int);
130 
132 
136  vtkSetMacro(AutoAdjustImageQuality, int);
137  vtkBooleanMacro(AutoAdjustImageQuality, int);
138  vtkGetMacro(AutoAdjustImageQuality, int);
140 
142 
148  vtkSetMacro(ResampleToScreenPixels, int);
149  vtkBooleanMacro(ResampleToScreenPixels, int);
150  vtkGetMacro(ResampleToScreenPixels, int);
152 
154 
160  vtkSetMacro(SeparateWindowLevelOperation, int);
161  vtkBooleanMacro(SeparateWindowLevelOperation, int);
162  vtkGetMacro(SeparateWindowLevelOperation, int);
164 
166 
170  virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler);
171  virtual vtkAbstractImageInterpolator *GetInterpolator();
173 
177  virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop);
178 
184  virtual void ReleaseGraphicsResources(vtkWindow *);
185 
190 
192 
196  double *GetBounds();
197  void GetBounds(double bounds[6])
198  { this->vtkAbstractMapper3D::GetBounds(bounds); };
200 
204  int ProcessRequest(vtkInformation* request,
205  vtkInformationVector** inInfo,
206  vtkInformationVector* outInfo);
207 
208 protected:
211 
215  void CheckerboardImage(
216  vtkImageData *input, vtkCamera *camera, vtkImageProperty *property);
217 
221  void UpdateSliceToWorldMatrix(vtkCamera *camera);
222 
227  void UpdateWorldToDataMatrix(vtkImageSlice *prop);
228 
232  void UpdateResliceMatrix(vtkRenderer *ren, vtkImageSlice *prop);
233 
238  void UpdateResliceInformation(vtkRenderer *ren);
239 
243  void UpdateResliceInterpolation(vtkImageProperty *property);
244 
248  void UpdateColorInformation(vtkImageProperty *property);
249 
253  void UpdatePolygonCoords(vtkRenderer *ren);
254 
256 
259  virtual void Update(int port);
260  virtual void Update();
261  virtual int Update(int port, vtkInformationVector* requests);
262  virtual int Update(vtkInformation* requests);
264 
268  void ReportReferences(vtkGarbageCollector*) VTK_OVERRIDE;
269 
270  vtkImageSliceMapper *SliceMapper; // Does the OpenGL rendering
271 
272  int JumpToNearestSlice; // Adjust SliceAtFocalPoint
273  int AutoAdjustImageQuality; // LOD-style behavior
274  int SeparateWindowLevelOperation; // Do window/level as a separate step
275  double SlabThickness; // Current slab thickness
276  int SlabType; // Current slab mode
277  int SlabSampleFactor; // Sampling factor for slab mode
278  int ImageSampleFactor; // Sampling factor for image pixels
279  int ResampleToScreenPixels; // Use software interpolation only
280  int InternalResampleToScreenPixels; // Use software interpolation only
281  int ResliceNeedUpdate; // Execute reslice on next render
282  vtkImageResliceToColors *ImageReslice; // For software interpolation
283  vtkMatrix4x4 *ResliceMatrix; // Cached reslice matrix
284  vtkMatrix4x4 *WorldToDataMatrix; // World to Data transform matrix
285  vtkMatrix4x4 *SliceToWorldMatrix; // Slice to World transform matrix
286  vtkTimeStamp UpdateTime;
287 
288 private:
289  vtkImageResliceMapper(const vtkImageResliceMapper&) VTK_DELETE_FUNCTION;
290  void operator=(const vtkImageResliceMapper&) VTK_DELETE_FUNCTION;
291 };
292 
293 #endif
interpolate data values from images
#define VTK_IMAGE_SLAB_MAX
Reslice and produce color scalars.
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:41
#define VTK_IMAGE_SLAB_MIN
Store vtkAlgorithm input/output information.
virtual vtkMTimeType GetMTime()
Override Modifiedtime as we have added Clipping planes.
void GetBounds(double bounds[6])
The bounding box (array of six doubles) of the data expressed as (xmin,xmax, ymin,ymax, zmin,zmax).
#define VTK_IMAGE_SLAB_SUM
#define VTK_IMAGE_SLAB_MEAN
void ReportReferences(vtkGarbageCollector *) override
record modification and/or execution time
Definition: vtkTimeStamp.h:35
map scalar values into colors via a lookup table
image display properties
abstract specification for renderers
Definition: vtkRenderer.h:63
void SetSlabTypeToMin()
The slab type, for thick slicing (default: Mean).
virtual void ReleaseGraphicsResources(vtkWindow *)=0
Release any graphics resources that are being consumed by this mapper.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
Detect and break reference loops.
void SetSlabTypeToMax()
The slab type, for thick slicing (default: Mean).
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
a simple class to control print indentation
Definition: vtkIndent.h:39
abstract class for mapping images to the screen
map a slice of a vtkImageData to the screen
a virtual camera for 3D rendering
Definition: vtkCamera.h:50
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop)=0
This should only be called by the renderer.
perform various plane computations
Definition: vtkPlane.h:37
virtual double * GetBounds()=0
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax, zmin,zmax).
virtual void Update()
Bring this algorithm's outputs up-to-date.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
create a window for renderers to draw into
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Handle requests from the pipeline executive.
represents an image in a 3D scene
Definition: vtkImageSlice.h:52
Store zero or more vtkInformation instances.
map a slice of a vtkImageData to the screen
static vtkAlgorithm * New()
void SetSlabTypeToSum()
The slab type, for thick slicing (default: Mean).
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetSlabTypeToMean()
The slab type, for thick slicing (default: Mean).
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.