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) override;
58 
65  virtual void SetSlicePlane(vtkPlane *plane);
66 
68 
74  vtkSetMacro(JumpToNearestSlice, vtkTypeBool);
75  vtkBooleanMacro(JumpToNearestSlice, vtkTypeBool);
76  vtkGetMacro(JumpToNearestSlice, vtkTypeBool);
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, vtkTypeBool);
137  vtkBooleanMacro(AutoAdjustImageQuality, vtkTypeBool);
138  vtkGetMacro(AutoAdjustImageQuality, vtkTypeBool);
140 
142 
148  vtkSetMacro(ResampleToScreenPixels, vtkTypeBool);
149  vtkBooleanMacro(ResampleToScreenPixels, vtkTypeBool);
150  vtkGetMacro(ResampleToScreenPixels, vtkTypeBool);
152 
154 
160  vtkSetMacro(SeparateWindowLevelOperation, vtkTypeBool);
161  vtkBooleanMacro(SeparateWindowLevelOperation, vtkTypeBool);
162  vtkGetMacro(SeparateWindowLevelOperation, vtkTypeBool);
164 
166 
170  virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler);
171  virtual vtkAbstractImageInterpolator *GetInterpolator();
173 
177  void Render(vtkRenderer *renderer, vtkImageSlice *prop) override;
178 
184  void ReleaseGraphicsResources(vtkWindow *) override;
185 
189  vtkMTimeType GetMTime() override;
190 
192 
196  double *GetBounds() override;
197  void GetBounds(double bounds[6]) override
198  { this->vtkAbstractMapper3D::GetBounds(bounds); };
200 
204  int ProcessRequest(vtkInformation* request,
205  vtkInformationVector** inInfo,
206  vtkInformationVector* outInfo) override;
207 
208 protected:
210  ~vtkImageResliceMapper() override;
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  void Update(int port) override;
260  void Update() override;
261  int Update(int port, vtkInformationVector* requests) override;
262  int Update(vtkInformation* requests) override;
264 
268  void ReportReferences(vtkGarbageCollector*) override;
269 
270  vtkImageSliceMapper *SliceMapper; // Does the OpenGL rendering
271 
272  vtkTypeBool JumpToNearestSlice; // Adjust SliceAtFocalPoint
273  vtkTypeBool AutoAdjustImageQuality; // LOD-style behavior
274  vtkTypeBool 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  vtkTypeBool 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
287 
288 private:
290  void operator=(const vtkImageResliceMapper&) = delete;
291 };
292 
293 #endif
void ReleaseGraphicsResources(vtkWindow *) override=0
Release any graphics resources that are being consumed by this mapper.
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.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
vtkMTimeType GetMTime() override
Override Modifiedtime as we have added Clipping planes.
#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
vtkImageResliceToColors * ImageReslice
void SetSlabTypeToMin()
The slab type, for thick slicing (default: Mean).
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Detect and break reference loops.
void GetBounds(double bounds[6]) override
The bounding box (array of six doubles) of the data expressed as (xmin,xmax, ymin,ymax, zmin,zmax).
vtkTypeBool SeparateWindowLevelOperation
void SetSlabTypeToMax()
The slab type, for thick slicing (default: Mean).
int vtkTypeBool
Definition: vtkABI.h:69
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.
int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Handle requests from the pipeline executive.
perform various plane computations
Definition: vtkPlane.h:37
vtkImageSliceMapper * SliceMapper
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.
create a window for renderers to draw into
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).
void SetSlabTypeToMean()
The slab type, for thick slicing (default: Mean).