VTK  9.5.20250718
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
49#ifndef vtkImageResliceMapper_h
50#define vtkImageResliceMapper_h
51
52#include "vtkImageMapper3D.h"
53#include "vtkRenderingImageModule.h" // For export macro
54#include "vtkWrappingHints.h"
55
56VTK_ABI_NAMESPACE_BEGIN
58class vtkRenderer;
59class vtkRenderWindow;
60class vtkCamera;
61class vtkLookupTable;
62class vtkImageSlice;
63class vtkImageData;
65class vtkMatrix4x4;
68
69class VTKRENDERINGIMAGE_EXPORT VTK_MARSHALAUTO vtkImageResliceMapper : public vtkImageMapper3D
70{
71public:
74 void PrintSelf(ostream& os, vtkIndent indent) override;
75
77
83 virtual void SetSlicePlane(vtkPlane* plane);
84 vtkPlane* GetSlicePlane() override { return this->SlicePlane; }
86
88
94 vtkSetMacro(JumpToNearestSlice, vtkTypeBool);
95 vtkBooleanMacro(JumpToNearestSlice, vtkTypeBool);
96 vtkGetMacro(JumpToNearestSlice, vtkTypeBool);
98
100
103 vtkSetMacro(SlabThickness, double);
104 vtkGetMacro(SlabThickness, double);
106
108
117 vtkSetClampMacro(SlabType, int, VTK_IMAGE_SLAB_MIN, VTK_IMAGE_SLAB_SUM);
118 vtkGetMacro(SlabType, int);
119 void SetSlabTypeToMin() { this->SetSlabType(VTK_IMAGE_SLAB_MIN); }
120 void SetSlabTypeToMax() { this->SetSlabType(VTK_IMAGE_SLAB_MAX); }
121 void SetSlabTypeToMean() { this->SetSlabType(VTK_IMAGE_SLAB_MEAN); }
122 void SetSlabTypeToSum() { this->SetSlabType(VTK_IMAGE_SLAB_SUM); }
123 virtual const char* GetSlabTypeAsString();
125
127
132 vtkSetClampMacro(SlabSampleFactor, int, 1, 2);
133 vtkGetMacro(SlabSampleFactor, int);
135
137
143 vtkSetClampMacro(ImageSampleFactor, int, 1, 16);
144 vtkGetMacro(ImageSampleFactor, int);
146
148
152 vtkSetMacro(AutoAdjustImageQuality, vtkTypeBool);
153 vtkBooleanMacro(AutoAdjustImageQuality, vtkTypeBool);
154 vtkGetMacro(AutoAdjustImageQuality, vtkTypeBool);
156
158
164 vtkSetMacro(ResampleToScreenPixels, vtkTypeBool);
165 vtkBooleanMacro(ResampleToScreenPixels, vtkTypeBool);
166 vtkGetMacro(ResampleToScreenPixels, vtkTypeBool);
168
170
176 vtkSetMacro(SeparateWindowLevelOperation, vtkTypeBool);
177 vtkBooleanMacro(SeparateWindowLevelOperation, vtkTypeBool);
178 vtkGetMacro(SeparateWindowLevelOperation, vtkTypeBool);
180
182
187 virtual void SetInterpolator(vtkAbstractImageInterpolator* interpolator);
189 virtual vtkAbstractImageInterpolator* GetInterpolator();
191
195 void Render(vtkRenderer* renderer, vtkImageSlice* prop) override;
196
202 void ReleaseGraphicsResources(vtkWindow*) override;
203
207 vtkMTimeType GetMTime() override;
208
210
214 double* GetBounds() override;
215 void GetBounds(double bounds[6]) override { this->vtkAbstractMapper3D::GetBounds(bounds); }
217
222 vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
223
224 // return the bounds in index space
225 void GetIndexBounds(double extent[6]) override;
226
227 vtkGetObjectMacro(ImageReslice, vtkImageResliceToColors);
229
230protected:
233
238
243
249
254
260
265
270
275
277
280 void Update(int port) override;
281 void Update() override;
282 vtkTypeBool Update(int port, vtkInformationVector* requests) override;
283 vtkTypeBool Update(vtkInformation* requests) override;
285
290
291 vtkImageChangeInformation* ChangeInformation; // Prepare image for mapper
292 vtkImageSliceMapper* SliceMapper; // Does the OpenGL rendering
293
294 vtkTypeBool JumpToNearestSlice; // Adjust SliceAtFocalPoint
295 vtkTypeBool AutoAdjustImageQuality; // LOD-style behavior
296 vtkTypeBool SeparateWindowLevelOperation; // Do window/level as a separate step
297 double SlabThickness; // Current slab thickness
298 int SlabType; // Current slab mode
299 int SlabSampleFactor; // Sampling factor for slab mode
300 int ImageSampleFactor; // Sampling factor for image pixels
301 vtkTypeBool ResampleToScreenPixels; // Use software interpolation only
302 int InternalResampleToScreenPixels; // Use software interpolation only
303 int ResliceNeedUpdate; // Execute reslice on next render
304 vtkImageResliceToColors* ImageReslice; // For software interpolation
305 vtkMatrix4x4* ResliceMatrix; // Cached reslice matrix
306 vtkMatrix4x4* WorldToDataMatrix; // World to Data transform matrix
307 vtkMatrix4x4* DataToSliceMatrix; // Data to Slice transform matrix
308 vtkMatrix4x4* SliceToWorldMatrix; // Slice to World transform matrix
310
311private:
313 void operator=(const vtkImageResliceMapper&) = delete;
314};
315
316VTK_ABI_NAMESPACE_END
317#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:151
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 SetImageReslice(vtkImageResliceToColors *)
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).
virtual const char * GetSlabTypeAsString()
The slab type, for thick slicing (default: Mean).
void SetSlabTypeToMean()
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.
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.
vtkImageSliceMapper * SliceMapper
void Update(int port) override
Override Update to handle some tricky details.
vtkPlane * GetSlicePlane() override
Set the slice that will be used to cut through the image.
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.
void UpdatePolygonCoords(vtkRenderer *ren)
Make a polygon by cutting the data bounds with a plane.
vtkImageChangeInformation * ChangeInformation
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:108
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:141
create a window for renderers to draw into
abstract specification for renderers
record modification and/or execution time
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
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:287
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)