VTK  9.2.6
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 =========================================================================*/
32 #ifndef vtkImageResliceMapper_h
33 #define vtkImageResliceMapper_h
34 
35 #include "vtkImageMapper3D.h"
36 #include "vtkRenderingImageModule.h" // For export macro
37 
39 class vtkRenderer;
40 class vtkRenderWindow;
41 class vtkCamera;
42 class vtkLookupTable;
43 class vtkImageSlice;
44 class vtkImageData;
46 class vtkMatrix4x4;
48 
49 class VTKRENDERINGIMAGE_EXPORT vtkImageResliceMapper : public vtkImageMapper3D
50 {
51 public:
52  static vtkImageResliceMapper* New();
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
62  virtual void SetSlicePlane(vtkPlane* plane);
63 
65 
71  vtkSetMacro(JumpToNearestSlice, vtkTypeBool);
72  vtkBooleanMacro(JumpToNearestSlice, vtkTypeBool);
73  vtkGetMacro(JumpToNearestSlice, vtkTypeBool);
75 
77 
80  vtkSetMacro(SlabThickness, double);
81  vtkGetMacro(SlabThickness, double);
83 
85 
94  vtkSetClampMacro(SlabType, int, VTK_IMAGE_SLAB_MIN, VTK_IMAGE_SLAB_SUM);
95  vtkGetMacro(SlabType, int);
96  void SetSlabTypeToMin() { this->SetSlabType(VTK_IMAGE_SLAB_MIN); }
97  void SetSlabTypeToMax() { this->SetSlabType(VTK_IMAGE_SLAB_MAX); }
98  void SetSlabTypeToMean() { this->SetSlabType(VTK_IMAGE_SLAB_MEAN); }
99  void SetSlabTypeToSum() { this->SetSlabType(VTK_IMAGE_SLAB_SUM); }
100  virtual const char* GetSlabTypeAsString();
102 
104 
109  vtkSetClampMacro(SlabSampleFactor, int, 1, 2);
110  vtkGetMacro(SlabSampleFactor, int);
112 
114 
120  vtkSetClampMacro(ImageSampleFactor, int, 1, 16);
121  vtkGetMacro(ImageSampleFactor, int);
123 
125 
129  vtkSetMacro(AutoAdjustImageQuality, vtkTypeBool);
130  vtkBooleanMacro(AutoAdjustImageQuality, vtkTypeBool);
131  vtkGetMacro(AutoAdjustImageQuality, vtkTypeBool);
133 
135 
141  vtkSetMacro(ResampleToScreenPixels, vtkTypeBool);
142  vtkBooleanMacro(ResampleToScreenPixels, vtkTypeBool);
143  vtkGetMacro(ResampleToScreenPixels, vtkTypeBool);
145 
147 
153  vtkSetMacro(SeparateWindowLevelOperation, vtkTypeBool);
154  vtkBooleanMacro(SeparateWindowLevelOperation, vtkTypeBool);
155  vtkGetMacro(SeparateWindowLevelOperation, vtkTypeBool);
157 
159 
163  virtual void SetInterpolator(vtkAbstractImageInterpolator* interpolator);
164  virtual vtkAbstractImageInterpolator* GetInterpolator();
166 
170  void Render(vtkRenderer* renderer, vtkImageSlice* prop) override;
171 
177  void ReleaseGraphicsResources(vtkWindow*) override;
178 
182  vtkMTimeType GetMTime() override;
183 
185 
189  double* GetBounds() override;
190  void GetBounds(double bounds[6]) override { this->vtkAbstractMapper3D::GetBounds(bounds); }
192 
197  vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) override;
198 
199  // return the bounds in index space
200  void GetIndexBounds(double extent[6]) override;
201 
202 protected:
204  ~vtkImageResliceMapper() override;
205 
209  void CheckerboardImage(vtkImageData* input, vtkCamera* camera, vtkImageProperty* property);
210 
214  void UpdateSliceToWorldMatrix(vtkCamera* camera);
215 
220  void UpdateWorldToDataMatrix(vtkImageSlice* prop);
221 
225  void UpdateResliceMatrix(vtkRenderer* ren, vtkImageSlice* prop);
226 
231  void UpdateResliceInformation(vtkRenderer* ren);
232 
236  void UpdateResliceInterpolation(vtkImageProperty* property);
237 
241  void UpdateColorInformation(vtkImageProperty* property);
242 
246  void UpdatePolygonCoords(vtkRenderer* ren);
247 
249 
252  void Update(int port) override;
253  void Update() override;
254  vtkTypeBool Update(int port, vtkInformationVector* requests) override;
255  vtkTypeBool Update(vtkInformation* requests) override;
257 
261  void ReportReferences(vtkGarbageCollector*) override;
262 
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* SliceToWorldMatrix; // Slice to World transform matrix
280 
281 private:
283  void operator=(const vtkImageResliceMapper&) = delete;
284 };
285 
286 #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:287
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:72
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:38
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:51
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop)=0
This should only be called by the renderer.
perform various plane computations
Definition: vtkPlane.h:36
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.
virtual void GetIndexBounds(double extent[6])=0
create a window for renderers to draw into
represents an image in a 3D scene
Definition: vtkImageSlice.h:49
vtkTypeBool ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Handle requests from the pipeline executive.
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).