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 
42 class vtkRenderer;
43 class vtkRenderWindow;
44 class vtkCamera;
45 class vtkLookupTable;
46 class vtkImageSlice;
47 class vtkImageData;
49 class vtkMatrix4x4;
51 
52 class VTKRENDERINGIMAGE_EXPORT vtkImageResliceMapper : public vtkImageMapper3D
53 {
54 public:
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 
208 protected:
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 
288 private:
289  vtkImageResliceMapper(const vtkImageResliceMapper&) VTK_DELETE_FUNCTION;
290  void operator=(const vtkImageResliceMapper&) VTK_DELETE_FUNCTION;
291 };
292 
293 #endif
vtkImageResliceMapper::UpdateColorInformation
void UpdateColorInformation(vtkImageProperty *property)
Update anything related to the image coloring.
vtkImageResliceMapper::New
static vtkImageResliceMapper * New()
vtkImageResliceMapper::ProcessRequest
int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
Handle requests from the pipeline executive.
vtkPlane
perform various plane computations
Definition: vtkPlane.h:38
vtkImageResliceMapper::SetSlabTypeToMax
void SetSlabTypeToMax()
Definition: vtkImageResliceMapper.h:101
vtkImageResliceMapper::InternalResampleToScreenPixels
int InternalResampleToScreenPixels
Definition: vtkImageResliceMapper.h:280
vtkAbstractMapper3D::GetBounds
virtual double * GetBounds()=0
Return bounding box (array of six doubles) of data expressed as (xmin,xmax, ymin,ymax,...
vtkImageResliceMapper::SlabThickness
double SlabThickness
Definition: vtkImageResliceMapper.h:275
vtkImageResliceMapper::SliceToWorldMatrix
vtkMatrix4x4 * SliceToWorldMatrix
Definition: vtkImageResliceMapper.h:285
VTK_IMAGE_SLAB_MAX
#define VTK_IMAGE_SLAB_MAX
Definition: vtkSystemIncludes.h:113
vtkImageResliceMapper::UpdateResliceInformation
void UpdateResliceInformation(vtkRenderer *ren)
Set all of the reslicing parameters.
vtkImageResliceMapper::GetInterpolator
virtual vtkAbstractImageInterpolator * GetInterpolator()
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:36
vtkImageResliceMapper::ImageSampleFactor
int ImageSampleFactor
Definition: vtkImageResliceMapper.h:278
vtkImageResliceMapper::GetSlabTypeAsString
virtual const char * GetSlabTypeAsString()
vtkImageResliceMapper::ReportReferences
void ReportReferences(vtkGarbageCollector *) override
Garbage collection for reference loops.
vtkImageResliceMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkImageResliceMapper::SlabType
int SlabType
Definition: vtkImageResliceMapper.h:276
vtkImageResliceMapper::Update
virtual void Update(int port)
Override Update to handle some tricky details.
vtkImageSliceMapper
map a slice of a vtkImageData to the screen
Definition: vtkImageSliceMapper.h:43
vtkImageResliceMapper::Update
virtual void Update()
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkMTimeType
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
vtkImageResliceMapper::UpdateResliceInterpolation
void UpdateResliceInterpolation(vtkImageProperty *property)
Set the interpolation.
vtkImageResliceMapper::UpdateSliceToWorldMatrix
void UpdateSliceToWorldMatrix(vtkCamera *camera)
Update the slice-to-world matrix from the camera.
vtkImageResliceMapper::SetSlabTypeToMin
void SetSlabTypeToMin()
Definition: vtkImageResliceMapper.h:99
VTK_IMAGE_SLAB_MEAN
#define VTK_IMAGE_SLAB_MEAN
Definition: vtkSystemIncludes.h:114
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkImageResliceMapper::JumpToNearestSlice
int JumpToNearestSlice
Definition: vtkImageResliceMapper.h:272
vtkImageSlice
represents an image in a 3D scene
Definition: vtkImageSlice.h:53
vtkImageProperty
image display properties
Definition: vtkImageProperty.h:43
vtkImageResliceMapper::Render
virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop)
This should only be called by the renderer.
vtkImageResliceMapper::SlabSampleFactor
int SlabSampleFactor
Definition: vtkImageResliceMapper.h:277
vtkImageResliceMapper::SetSlabTypeToSum
void SetSlabTypeToSum()
Definition: vtkImageResliceMapper.h:105
VTK_IMAGE_SLAB_MIN
#define VTK_IMAGE_SLAB_MIN
Definition: vtkSystemIncludes.h:112
vtkImageResliceMapper::ResampleToScreenPixels
int ResampleToScreenPixels
Definition: vtkImageResliceMapper.h:279
vtkImageResliceMapper::SetInterpolator
virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler)
Set a custom interpolator.
vtkImageResliceMapper::UpdateResliceMatrix
void UpdateResliceMatrix(vtkRenderer *ren, vtkImageSlice *prop)
Update the reslice matrix, which is the slice-to-data matrix.
vtkImageResliceMapper::WorldToDataMatrix
vtkMatrix4x4 * WorldToDataMatrix
Definition: vtkImageResliceMapper.h:284
vtkImageResliceMapper::ResliceNeedUpdate
int ResliceNeedUpdate
Definition: vtkImageResliceMapper.h:281
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:42
vtkImageResliceMapper::UpdateWorldToDataMatrix
void UpdateWorldToDataMatrix(vtkImageSlice *prop)
Check if the vtkProp3D matrix has changed, and if so, set the WorldToDataMatrix to its inverse.
vtkImageResliceMapper
map a slice of a vtkImageData to the screen
Definition: vtkImageResliceMapper.h:53
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:51
vtkImageResliceMapper::Update
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...
vtkImageResliceMapper::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this mapper.
vtkImageResliceMapper::CheckerboardImage
void CheckerboardImage(vtkImageData *input, vtkCamera *camera, vtkImageProperty *property)
Do a checkerboard pattern to the alpha of an RGBA image.
vtkImageResliceMapper::Update
virtual int Update(vtkInformation *requests)
Convenience method to update an algorithm after passing requests to its first output port.
vtkImageResliceMapper::SetSlicePlane
virtual void SetSlicePlane(vtkPlane *plane)
Set the slice that will be used to cut through the image.
vtkImageResliceMapper::SliceMapper
vtkImageSliceMapper * SliceMapper
Definition: vtkImageResliceMapper.h:270
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:100
vtkImageResliceMapper::GetBounds
void GetBounds(double bounds[6])
Get the bounds for this mapper as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
Definition: vtkImageResliceMapper.h:197
vtkImageResliceMapper::GetBounds
double * GetBounds()
The bounding box (array of six doubles) of the data expressed as (xmin,xmax, ymin,...
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:87
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:75
vtkImageMapper3D
abstract class for mapping images to the screen
Definition: vtkImageMapper3D.h:51
vtkImageResliceMapper::GetMTime
vtkMTimeType GetMTime()
Get the mtime for the mapper.
vtkImageResliceMapper::UpdateTime
vtkTimeStamp UpdateTime
Definition: vtkImageResliceMapper.h:286
vtkImageResliceMapper::ResliceMatrix
vtkMatrix4x4 * ResliceMatrix
Definition: vtkImageResliceMapper.h:283
VTK_IMAGE_SLAB_SUM
#define VTK_IMAGE_SLAB_SUM
Definition: vtkSystemIncludes.h:115
vtkImageResliceToColors
Reslice and produce color scalars.
Definition: vtkImageResliceToColors.h:44
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkImageResliceMapper::vtkImageResliceMapper
vtkImageResliceMapper()
vtkImageMapper3D.h
vtkImageResliceMapper::AutoAdjustImageQuality
int AutoAdjustImageQuality
Definition: vtkImageResliceMapper.h:273
vtkImageResliceMapper::SeparateWindowLevelOperation
int SeparateWindowLevelOperation
Definition: vtkImageResliceMapper.h:274
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:87
vtkAbstractImageInterpolator
interpolate data values from images
Definition: vtkAbstractImageInterpolator.h:50
vtkImageResliceMapper::UpdatePolygonCoords
void UpdatePolygonCoords(vtkRenderer *ren)
Make a polygon by cutting the data bounds with a plane.
vtkImageResliceMapper::~vtkImageResliceMapper
~vtkImageResliceMapper()
vtkImageResliceMapper::ImageReslice
vtkImageResliceToColors * ImageReslice
Definition: vtkImageResliceMapper.h:282
vtkImageResliceMapper::SetSlabTypeToMean
void SetSlabTypeToMean()
Definition: vtkImageResliceMapper.h:103