VTK  9.3.0
vtkImageResliceMapper.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
23#ifndef vtkImageResliceMapper_h
24#define vtkImageResliceMapper_h
25
26#include "vtkImageMapper3D.h"
27#include "vtkRenderingImageModule.h" // For export macro
28
29VTK_ABI_NAMESPACE_BEGIN
31class vtkRenderer;
32class vtkRenderWindow;
33class vtkCamera;
34class vtkLookupTable;
35class vtkImageSlice;
36class vtkImageData;
38class vtkMatrix4x4;
41
42class VTKRENDERINGIMAGE_EXPORT vtkImageResliceMapper : public vtkImageMapper3D
43{
44public:
47 void PrintSelf(ostream& os, vtkIndent indent) override;
48
55 virtual void SetSlicePlane(vtkPlane* plane);
56
58
64 vtkSetMacro(JumpToNearestSlice, vtkTypeBool);
65 vtkBooleanMacro(JumpToNearestSlice, vtkTypeBool);
66 vtkGetMacro(JumpToNearestSlice, vtkTypeBool);
68
70
73 vtkSetMacro(SlabThickness, double);
74 vtkGetMacro(SlabThickness, double);
76
78
87 vtkSetClampMacro(SlabType, int, VTK_IMAGE_SLAB_MIN, VTK_IMAGE_SLAB_SUM);
88 vtkGetMacro(SlabType, int);
89 void SetSlabTypeToMin() { this->SetSlabType(VTK_IMAGE_SLAB_MIN); }
90 void SetSlabTypeToMax() { this->SetSlabType(VTK_IMAGE_SLAB_MAX); }
91 void SetSlabTypeToMean() { this->SetSlabType(VTK_IMAGE_SLAB_MEAN); }
92 void SetSlabTypeToSum() { this->SetSlabType(VTK_IMAGE_SLAB_SUM); }
93 virtual const char* GetSlabTypeAsString();
95
97
102 vtkSetClampMacro(SlabSampleFactor, int, 1, 2);
103 vtkGetMacro(SlabSampleFactor, int);
105
107
113 vtkSetClampMacro(ImageSampleFactor, int, 1, 16);
114 vtkGetMacro(ImageSampleFactor, int);
116
118
122 vtkSetMacro(AutoAdjustImageQuality, vtkTypeBool);
123 vtkBooleanMacro(AutoAdjustImageQuality, vtkTypeBool);
124 vtkGetMacro(AutoAdjustImageQuality, vtkTypeBool);
126
128
134 vtkSetMacro(ResampleToScreenPixels, vtkTypeBool);
135 vtkBooleanMacro(ResampleToScreenPixels, vtkTypeBool);
136 vtkGetMacro(ResampleToScreenPixels, vtkTypeBool);
138
140
146 vtkSetMacro(SeparateWindowLevelOperation, vtkTypeBool);
147 vtkBooleanMacro(SeparateWindowLevelOperation, vtkTypeBool);
148 vtkGetMacro(SeparateWindowLevelOperation, vtkTypeBool);
150
152
159
163 void Render(vtkRenderer* renderer, vtkImageSlice* prop) override;
164
171
176
178
182 double* GetBounds() override;
183 void GetBounds(double bounds[6]) override { this->vtkAbstractMapper3D::GetBounds(bounds); }
185
190 vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
191
192 // return the bounds in index space
193 void GetIndexBounds(double extent[6]) override;
194
195protected:
198
203
208
214
219
225
230
235
240
242
245 void Update(int port) override;
246 void Update() override;
247 vtkTypeBool Update(int port, vtkInformationVector* requests) override;
248 vtkTypeBool Update(vtkInformation* requests) override;
250
255
256 vtkImageChangeInformation* ChangeInformation; // Prepare image for mapper
257 vtkImageSliceMapper* SliceMapper; // Does the OpenGL rendering
258
259 vtkTypeBool JumpToNearestSlice; // Adjust SliceAtFocalPoint
260 vtkTypeBool AutoAdjustImageQuality; // LOD-style behavior
261 vtkTypeBool SeparateWindowLevelOperation; // Do window/level as a separate step
262 double SlabThickness; // Current slab thickness
263 int SlabType; // Current slab mode
264 int SlabSampleFactor; // Sampling factor for slab mode
265 int ImageSampleFactor; // Sampling factor for image pixels
266 vtkTypeBool ResampleToScreenPixels; // Use software interpolation only
267 int InternalResampleToScreenPixels; // Use software interpolation only
268 int ResliceNeedUpdate; // Execute reslice on next render
269 vtkImageResliceToColors* ImageReslice; // For software interpolation
270 vtkMatrix4x4* ResliceMatrix; // Cached reslice matrix
271 vtkMatrix4x4* WorldToDataMatrix; // World to Data transform matrix
272 vtkMatrix4x4* DataToSliceMatrix; // Data to Slice transform matrix
273 vtkMatrix4x4* SliceToWorldMatrix; // Slice to World transform matrix
275
276private:
278 void operator=(const vtkImageResliceMapper&) = delete;
279};
280
281VTK_ABI_NAMESPACE_END
282#endif
interpolate data values from images
virtual double * GetBounds()=0
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
a virtual camera for 3D rendering
Definition vtkCamera.h:41
Detect and break reference loops.
modify spacing, origin and extent.
topologically and geometrically regular array of data
abstract class for mapping images to the screen
image display properties
map a slice of a vtkImageData to the screen
void CheckerboardImage(vtkImageData *input, vtkCamera *camera, vtkImageProperty *property)
Do a checkerboard pattern to the alpha of an RGBA image.
void GetIndexBounds(double extent[6]) override
vtkImageResliceToColors * ImageReslice
void UpdateResliceInformation(vtkRenderer *ren)
Set all of the reslicing parameters.
void UpdateResliceInterpolation(vtkImageProperty *property)
Set the interpolation.
vtkTypeBool Update(vtkInformation *requests) override
Override Update to handle some tricky details.
void SetSlabTypeToSum()
The slab type, for thick slicing (default: Mean).
vtkMTimeType GetMTime() override
Get the mtime for the mapper.
void Render(vtkRenderer *renderer, vtkImageSlice *prop) override
This should only be called by the renderer.
virtual const char * GetSlabTypeAsString()
The slab type, for thick slicing (default: Mean).
void SetSlabTypeToMean()
The slab type, for thick slicing (default: Mean).
void GetBounds(double bounds[6]) override
The bounding box (array of six doubles) of the data expressed as (xmin,xmax, ymin,...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetSlicePlane(vtkPlane *plane)
Set the slice that will be used to cut through the image.
void ReportReferences(vtkGarbageCollector *) override
Garbage collection for reference loops.
virtual void SetInterpolator(vtkAbstractImageInterpolator *interpolator)
Set a custom interpolator.
vtkImageSliceMapper * SliceMapper
void Update(int port) override
Override Update to handle some tricky details.
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Handle requests from the pipeline executive.
vtkTypeBool Update(int port, vtkInformationVector *requests) override
Override Update to handle some tricky details.
static vtkImageResliceMapper * New()
void UpdateResliceMatrix(vtkRenderer *ren, vtkImageSlice *prop)
Update the reslice matrix, which is the slice-to-data matrix.
void Update() override
Override Update to handle some tricky details.
void UpdateWorldToDataMatrix(vtkImageSlice *prop)
Check if the vtkProp3D matrix has changed, and if so, set the WorldToDataMatrix to its inverse.
virtual vtkAbstractImageInterpolator * GetInterpolator()
Set a custom interpolator.
void UpdatePolygonCoords(vtkRenderer *ren)
Make a polygon by cutting the data bounds with a plane.
vtkImageChangeInformation * ChangeInformation
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
double * GetBounds() override
The bounding box (array of six doubles) of the data expressed as (xmin,xmax, ymin,...
void UpdateColorInformation(vtkImageProperty *property)
Update anything related to the image coloring.
void UpdateSliceToWorldMatrix(vtkCamera *camera)
Update the slice-to-world matrix from the camera.
void SetSlabTypeToMax()
The slab type, for thick slicing (default: Mean).
void SetSlabTypeToMin()
The slab type, for thick slicing (default: Mean).
~vtkImageResliceMapper() override
Reslice and produce color scalars.
map a slice of a vtkImageData to the screen
represents an image in a 3D scene
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
map scalar values into colors via a lookup table
represent and manipulate 4x4 transformation matrices
perform various plane computations
Definition vtkPlane.h:26
create a window for renderers to draw into
abstract specification for renderers
Definition vtkRenderer.h:62
record modification and/or execution time
window superclass for vtkRenderWindow
Definition vtkWindow.h:28
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_IMAGE_SLAB_MAX
#define VTK_IMAGE_SLAB_MIN
#define VTK_IMAGE_SLAB_SUM
#define VTK_IMAGE_SLAB_MEAN
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:270