VTK: Rendering/Image/vtkImageResliceMapper.h Source File

| VTK 9.3.1

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
29 #ifndef vtkImageResliceMapper_h
30 #define vtkImageResliceMapper_h
31
32 #include "vtkImageMapper3D.h"
33 #include "vtkRenderingImageModule.h" // For export macro
34
35 VTK_ABI_NAMESPACE_BEGIN
36 class vtkImageSliceMapper;
37 class vtkRenderer;
38 class vtkRenderWindow;
39 class vtkCamera;
40 class vtkLookupTable;
41 class vtkImageSlice;
42 class vtkImageData;
43 class vtkImageResliceToColors;
44 class vtkMatrix4x4;
45 class vtkAbstractImageInterpolator;
46 class vtkImageChangeInformation;
47
48 class VTKRENDERINGIMAGE_EXPORT vtkImageResliceMapper : public vtkImageMapper3D
49 {
50 public:
51 static vtkImageResliceMapper* New();
52 vtkTypeMacro(vtkImageResliceMapper, vtkImageMapper3D);
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
61 virtual void SetSlicePlane(vtkPlane* plane);
62
64
70 vtkSetMacro(JumpToNearestSlice, vtkTypeBool);
71 vtkBooleanMacro(JumpToNearestSlice, vtkTypeBool);
72 vtkGetMacro(JumpToNearestSlice, vtkTypeBool);
74
76
79 vtkSetMacro(SlabThickness, double);
80 vtkGetMacro(SlabThickness, double);
82
84
93 vtkSetClampMacro(SlabType, int, VTK_IMAGE_SLAB_MIN, VTK_IMAGE_SLAB_SUM);
94 vtkGetMacro(SlabType, int);
95 void SetSlabTypeToMin() { this->SetSlabType(VTK_IMAGE_SLAB_MIN); }
96 void SetSlabTypeToMax() { this->SetSlabType(VTK_IMAGE_SLAB_MAX); }
97 void SetSlabTypeToMean() { this->SetSlabType(VTK_IMAGE_SLAB_MEAN); }
98 void SetSlabTypeToSum() { this->SetSlabType(VTK_IMAGE_SLAB_SUM); }
99 virtual const char* GetSlabTypeAsString();
101
103
108 vtkSetClampMacro(SlabSampleFactor, int, 1, 2);
109 vtkGetMacro(SlabSampleFactor, int);
111
113
119 vtkSetClampMacro(ImageSampleFactor, int, 1, 16);
120 vtkGetMacro(ImageSampleFactor, int);
122
124
128 vtkSetMacro(AutoAdjustImageQuality, vtkTypeBool);
129 vtkBooleanMacro(AutoAdjustImageQuality, vtkTypeBool);
130 vtkGetMacro(AutoAdjustImageQuality, vtkTypeBool);
132
134
140 vtkSetMacro(ResampleToScreenPixels, vtkTypeBool);
141 vtkBooleanMacro(ResampleToScreenPixels, vtkTypeBool);
142 vtkGetMacro(ResampleToScreenPixels, vtkTypeBool);
144
146
152 vtkSetMacro(SeparateWindowLevelOperation, vtkTypeBool);
153 vtkBooleanMacro(SeparateWindowLevelOperation, vtkTypeBool);
154 vtkGetMacro(SeparateWindowLevelOperation, vtkTypeBool);
156
158
162 virtual void SetInterpolator(vtkAbstractImageInterpolator* interpolator);
163 virtual vtkAbstractImageInterpolator* GetInterpolator();
165
169 void Render(vtkRenderer* renderer, vtkImageSlice* prop) override;
170
176 void ReleaseGraphicsResources(vtkWindow*) override;
177
181 vtkMTimeType GetMTime() override;
182
184
188 double* GetBounds() override;
189 void GetBounds(double bounds[6]) override { this->vtkAbstractMapper3D::GetBounds(bounds); }
191
195 vtkTypeBool ProcessRequest(
196 vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
197
198 // return the bounds in index space
199 void GetIndexBounds(double extent[6]) override;
200
201 protected:
202 vtkImageResliceMapper();
203 ~vtkImageResliceMapper() override;
204
208 void CheckerboardImage(vtkImageData* input, vtkCamera* camera, vtkImageProperty* property);
209
213 void UpdateSliceToWorldMatrix(vtkCamera* camera);
214
219 void UpdateWorldToDataMatrix(vtkImageSlice* prop);
220
224 void UpdateResliceMatrix(vtkRenderer* ren, vtkImageSlice* prop);
225
230 void UpdateResliceInformation(vtkRenderer* ren);
231
235 void UpdateResliceInterpolation(vtkImageProperty* property);
236
240 void UpdateColorInformation(vtkImageProperty* property);
241
245 void UpdatePolygonCoords(vtkRenderer* ren);
246
248
251 void Update(int port) override;
252 void Update() override;
253 vtkTypeBool Update(int port, vtkInformationVector* requests) override;
254 vtkTypeBool Update(vtkInformation* requests) override;
256
260 void ReportReferences(vtkGarbageCollector*) override;
261
262 vtkImageChangeInformation* ChangeInformation; // Prepare image for mapper
263 vtkImageSliceMapper* SliceMapper; // Does the OpenGL rendering
264
265 vtkTypeBool JumpToNearestSlice; // Adjust SliceAtFocalPoint
266 vtkTypeBool AutoAdjustImageQuality; // LOD-style behavior
267 vtkTypeBool SeparateWindowLevelOperation; // Do window/level as a separate step
268 double SlabThickness; // Current slab thickness
269 int SlabType; // Current slab mode
270 int SlabSampleFactor; // Sampling factor for slab mode
271 int ImageSampleFactor; // Sampling factor for image pixels
272 vtkTypeBool ResampleToScreenPixels; // Use software interpolation only
273 int InternalResampleToScreenPixels; // Use software interpolation only
274 int ResliceNeedUpdate; // Execute reslice on next render
275 vtkImageResliceToColors* ImageReslice; // For software interpolation
276 vtkMatrix4x4* ResliceMatrix; // Cached reslice matrix
277 vtkMatrix4x4* WorldToDataMatrix; // World to Data transform matrix
278 vtkMatrix4x4* DataToSliceMatrix; // Data to Slice transform matrix
279 vtkMatrix4x4* SliceToWorldMatrix; // Slice to World transform matrix
280 vtkTimeStamp UpdateTime;
281
282 private:
283 vtkImageResliceMapper(const vtkImageResliceMapper&) = delete;
284 void operator=(const vtkImageResliceMapper&) = delete;
285 };
286
287 VTK_ABI_NAMESPACE_END
288 #endif
vtkAbstractImageInterpolator
interpolate data values from images
Definition: vtkAbstractImageInterpolator.h:42
vtkAbstractMapper3D::GetBounds
virtual double * GetBounds()=0
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:50
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:80
vtkImageChangeInformation
modify spacing, origin and extent.
Definition: vtkImageChangeInformation.h:37
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
vtkImageMapper3D
abstract class for mapping images to the screen
Definition: vtkImageMapper3D.h:50
vtkImageProperty
image display properties
Definition: vtkImageProperty.h:38
vtkImageResliceMapper
map a slice of a vtkImageData to the screen
Definition: vtkImageResliceMapper.h:49
vtkImageResliceMapper::ImageSampleFactor
int ImageSampleFactor
Definition: vtkImageResliceMapper.h:271
vtkImageResliceMapper::CheckerboardImage
void CheckerboardImage(vtkImageData *input, vtkCamera *camera, vtkImageProperty *property)
Do a checkerboard pattern to the alpha of an RGBA image.
vtkImageResliceMapper::GetIndexBounds
void GetIndexBounds(double extent[6]) override
vtkImageResliceMapper::ImageReslice
vtkImageResliceToColors * ImageReslice
Definition: vtkImageResliceMapper.h:275
vtkImageResliceMapper::UpdateResliceInformation
void UpdateResliceInformation(vtkRenderer *ren)
Set all of the reslicing parameters.
vtkImageResliceMapper::UpdateResliceInterpolation
void UpdateResliceInterpolation(vtkImageProperty *property)
Set the interpolation.
vtkImageResliceMapper::Update
vtkTypeBool Update(vtkInformation *requests) override
Override Update to handle some tricky details.
vtkImageResliceMapper::SetSlabTypeToSum
void SetSlabTypeToSum()
The slab type, for thick slicing (default: Mean).
Definition: vtkImageResliceMapper.h:98
vtkImageResliceMapper::GetMTime
vtkMTimeType GetMTime() override
Get the mtime for the mapper.
vtkImageResliceMapper::Render
void Render(vtkRenderer *renderer, vtkImageSlice *prop) override
This should only be called by the renderer.
vtkImageResliceMapper::DataToSliceMatrix
vtkMatrix4x4 * DataToSliceMatrix
Definition: vtkImageResliceMapper.h:278
vtkImageResliceMapper::UpdateTime
vtkTimeStamp UpdateTime
Definition: vtkImageResliceMapper.h:280
vtkImageResliceMapper::InternalResampleToScreenPixels
int InternalResampleToScreenPixels
Definition: vtkImageResliceMapper.h:273
vtkImageResliceMapper::SetSlabTypeToMean
void SetSlabTypeToMean()
The slab type, for thick slicing (default: Mean).
Definition: vtkImageResliceMapper.h:97
vtkImageResliceMapper::GetSlabTypeAsString
virtual const char * GetSlabTypeAsString()
The slab type, for thick slicing (default: Mean).
vtkImageResliceMapper::New
static vtkImageResliceMapper * New()
vtkImageResliceMapper::SeparateWindowLevelOperation
vtkTypeBool SeparateWindowLevelOperation
Definition: vtkImageResliceMapper.h:267
vtkImageResliceMapper::GetBounds
void GetBounds(double bounds[6]) override
The bounding box (array of six doubles) of the data expressed as (xmin,xmax, ymin,...
Definition: vtkImageResliceMapper.h:189
vtkImageResliceMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkImageResliceMapper::SetSlicePlane
virtual void SetSlicePlane(vtkPlane *plane)
Set the slice that will be used to cut through the image.
vtkImageResliceMapper::ReportReferences
void ReportReferences(vtkGarbageCollector *) override
Garbage collection for reference loops.
vtkImageResliceMapper::WorldToDataMatrix
vtkMatrix4x4 * WorldToDataMatrix
Definition: vtkImageResliceMapper.h:277
vtkImageResliceMapper::SetInterpolator
virtual void SetInterpolator(vtkAbstractImageInterpolator *interpolator)
Set a custom interpolator.
vtkImageResliceMapper::SlabSampleFactor
int SlabSampleFactor
Definition: vtkImageResliceMapper.h:270
vtkImageResliceMapper::SliceMapper
vtkImageSliceMapper * SliceMapper
Definition: vtkImageResliceMapper.h:263
vtkImageResliceMapper::Update
void Update(int port) override
Override Update to handle some tricky details.
vtkImageResliceMapper::ResliceMatrix
vtkMatrix4x4 * ResliceMatrix
Definition: vtkImageResliceMapper.h:276
vtkImageResliceMapper::ProcessRequest
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Handle requests from the pipeline executive.
vtkImageResliceMapper::Update
vtkTypeBool Update(int port, vtkInformationVector *requests) override
Override Update to handle some tricky details.
vtkImageResliceMapper::AutoAdjustImageQuality
vtkTypeBool AutoAdjustImageQuality
Definition: vtkImageResliceMapper.h:266
vtkImageResliceMapper::UpdateResliceMatrix
void UpdateResliceMatrix(vtkRenderer *ren, vtkImageSlice *prop)
Update the reslice matrix, which is the slice-to-data matrix.
vtkImageResliceMapper::GetInterpolator
virtual vtkAbstractImageInterpolator * GetInterpolator()
Set a custom interpolator.
vtkImageResliceMapper::Update
void Update() override
Override Update to handle some tricky details.
vtkImageResliceMapper::UpdateWorldToDataMatrix
void UpdateWorldToDataMatrix(vtkImageSlice *prop)
Check if the vtkProp3D matrix has changed, and if so, set the WorldToDataMatrix to its inverse.
vtkImageResliceMapper::SlabThickness
double SlabThickness
Definition: vtkImageResliceMapper.h:268
vtkImageResliceMapper::UpdatePolygonCoords
void UpdatePolygonCoords(vtkRenderer *ren)
Make a polygon by cutting the data bounds with a plane.
vtkImageResliceMapper::ChangeInformation
vtkImageChangeInformation * ChangeInformation
Definition: vtkImageResliceMapper.h:262
vtkImageResliceMapper::SlabType
int SlabType
Definition: vtkImageResliceMapper.h:269
vtkImageResliceMapper::JumpToNearestSlice
vtkTypeBool JumpToNearestSlice
Definition: vtkImageResliceMapper.h:265
vtkImageResliceMapper::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
Release any graphics resources that are being consumed by this mapper.
vtkImageResliceMapper::GetBounds
double * GetBounds() override
The bounding box (array of six doubles) of the data expressed as (xmin,xmax, ymin,...
vtkImageResliceMapper::UpdateColorInformation
void UpdateColorInformation(vtkImageProperty *property)
Update anything related to the image coloring.
vtkImageResliceMapper::vtkImageResliceMapper
vtkImageResliceMapper()
vtkImageResliceMapper::ResliceNeedUpdate
int ResliceNeedUpdate
Definition: vtkImageResliceMapper.h:274
vtkImageResliceMapper::UpdateSliceToWorldMatrix
void UpdateSliceToWorldMatrix(vtkCamera *camera)
Update the slice-to-world matrix from the camera.
vtkImageResliceMapper::SetSlabTypeToMax
void SetSlabTypeToMax()
The slab type, for thick slicing (default: Mean).
Definition: vtkImageResliceMapper.h:96
vtkImageResliceMapper::SetSlabTypeToMin
void SetSlabTypeToMin()
The slab type, for thick slicing (default: Mean).
Definition: vtkImageResliceMapper.h:95
vtkImageResliceMapper::SliceToWorldMatrix
vtkMatrix4x4 * SliceToWorldMatrix
Definition: vtkImageResliceMapper.h:279
vtkImageResliceMapper::ResampleToScreenPixels
vtkTypeBool ResampleToScreenPixels
Definition: vtkImageResliceMapper.h:272
vtkImageResliceMapper::~vtkImageResliceMapper
~vtkImageResliceMapper() override
vtkImageResliceToColors
Reslice and produce color scalars.
Definition: vtkImageResliceToColors.h:32
vtkImageSliceMapper
map a slice of a vtkImageData to the screen
Definition: vtkImageSliceMapper.h:41
vtkImageSlice
represents an image in a 3D scene
Definition: vtkImageSlice.h:48
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:40
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:72
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:73
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:40
vtkPlane
perform various plane computations
Definition: vtkPlane.h:35
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:95
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:71
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:34
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkX3D::extent
@ extent
Definition: vtkX3D.h:345
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:64
vtkImageMapper3D.h
VTK_IMAGE_SLAB_MAX
#define VTK_IMAGE_SLAB_MAX
Definition: vtkSystemIncludes.h:88
VTK_IMAGE_SLAB_MIN
#define VTK_IMAGE_SLAB_MIN
Definition: vtkSystemIncludes.h:87
VTK_IMAGE_SLAB_SUM
#define VTK_IMAGE_SLAB_SUM
Definition: vtkSystemIncludes.h:90
VTK_IMAGE_SLAB_MEAN
#define VTK_IMAGE_SLAB_MEAN
Definition: vtkSystemIncludes.h:89
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270