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
42class vtkRenderer;
43class vtkRenderWindow;
44class vtkCamera;
45class vtkLookupTable;
46class vtkImageSlice;
47class vtkImageData;
49class vtkMatrix4x4;
51
52class VTKRENDERINGIMAGE_EXPORT vtkImageResliceMapper : public vtkImageMapper3D
53{
54public:
57 void PrintSelf(ostream& os, vtkIndent indent);
58
65 virtual void SetSlicePlane(vtkPlane *plane);
66
68
74 vtkSetMacro(JumpToNearestSlice, int);
75 vtkBooleanMacro(JumpToNearestSlice, int);
76 vtkGetMacro(JumpToNearestSlice, int);
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, int);
137 vtkBooleanMacro(AutoAdjustImageQuality, int);
138 vtkGetMacro(AutoAdjustImageQuality, int);
140
142
148 vtkSetMacro(ResampleToScreenPixels, int);
149 vtkBooleanMacro(ResampleToScreenPixels, int);
150 vtkGetMacro(ResampleToScreenPixels, int);
152
154
160 vtkSetMacro(SeparateWindowLevelOperation, int);
161 vtkBooleanMacro(SeparateWindowLevelOperation, int);
162 vtkGetMacro(SeparateWindowLevelOperation, int);
164
166
173
177 virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop);
178
185
190
192
196 double *GetBounds();
197 void GetBounds(double bounds[6])
198 { this->vtkAbstractMapper3D::GetBounds(bounds); };
200
205 vtkInformationVector** inInfo,
206 vtkInformationVector* outInfo);
207
208protected:
211
216 vtkImageData *input, vtkCamera *camera, vtkImageProperty *property);
217
222
228
233
239
244
249
254
256
259 virtual void Update(int port);
260 virtual void Update();
261 virtual int Update(int port, vtkInformationVector* requests);
262 virtual int Update(vtkInformation* requests);
264
269
270 vtkImageSliceMapper *SliceMapper; // Does the OpenGL rendering
271
272 int JumpToNearestSlice; // Adjust SliceAtFocalPoint
273 int AutoAdjustImageQuality; // LOD-style behavior
274 int 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 int 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
288private:
289 vtkImageResliceMapper(const vtkImageResliceMapper&) VTK_DELETE_FUNCTION;
290 void operator=(const vtkImageResliceMapper&) VTK_DELETE_FUNCTION;
291};
292
293#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:51
Detect and break reference loops.
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
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.
vtkImageResliceToColors * ImageReslice
void UpdateResliceInformation(vtkRenderer *ren)
Set all of the reslicing parameters.
double * GetBounds()
The bounding box (array of six doubles) of the data expressed as (xmin,xmax, ymin,...
virtual void Update(int port)
Override Update to handle some tricky details.
virtual void Update()
void UpdateResliceInterpolation(vtkImageProperty *property)
Set the interpolation.
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this mapper.
virtual const char * GetSlabTypeAsString()
vtkMTimeType GetMTime()
Get the mtime for the mapper.
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
virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop)
This should only be called by the renderer.
virtual int Update(vtkInformation *requests)
Convenience method to update an algorithm after passing requests to its first output port.
static vtkImageResliceMapper * New()
void UpdateResliceMatrix(vtkRenderer *ren, vtkImageSlice *prop)
Update the reslice matrix, which is the slice-to-data matrix.
void UpdateWorldToDataMatrix(vtkImageSlice *prop)
Check if the vtkProp3D matrix has changed, and if so, set the WorldToDataMatrix to its inverse.
virtual int Update(int port, vtkInformationVector *requests)
This method enables the passing of data requests to the algorithm to be used during execution (in add...
virtual vtkAbstractImageInterpolator * GetInterpolator()
int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Handle requests from the pipeline executive.
void UpdatePolygonCoords(vtkRenderer *ren)
Make a polygon by cutting the data bounds with a plane.
void GetBounds(double bounds[6])
Get the bounds for this mapper as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
void UpdateColorInformation(vtkImageProperty *property)
Update anything related to the image coloring.
virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler)
Set a custom interpolator.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void UpdateSliceToWorldMatrix(vtkCamera *camera)
Update the slice-to-world matrix from the camera.
Reslice and produce color scalars.
map a slice of a vtkImageData to the screen
represents an image in a 3D scene
Definition: vtkImageSlice.h:53
a simple class to control print indentation
Definition: vtkIndent.h:40
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
Definition: vtkMatrix4x4.h:42
perform various plane computations
Definition: vtkPlane.h:38
create a window for renderers to draw into
abstract specification for renderers
Definition: vtkRenderer.h:64
record modification and/or execution time
Definition: vtkTimeStamp.h:36
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ port
Definition: vtkX3D.h:447
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
#define VTK_IMAGE_SLAB_MAX
#define VTK_IMAGE_SLAB_MIN
#define VTK_IMAGE_SLAB_SUM
#define VTK_IMAGE_SLAB_MEAN
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248