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 =========================================================================*/
29 #ifndef vtkImageResliceMapper_h
30 #define vtkImageResliceMapper_h
31 
32 #include "vtkRenderingImageModule.h" // For export macro
33 #include "vtkImageMapper3D.h"
34 
36 class vtkRenderer;
37 class vtkRenderWindow;
38 class vtkCamera;
39 class vtkLookupTable;
40 class vtkImageSlice;
41 class vtkImageData;
43 class vtkMatrix4x4;
45 
46 class VTKRENDERINGIMAGE_EXPORT vtkImageResliceMapper : public vtkImageMapper3D
47 {
48 public:
49  static vtkImageResliceMapper *New();
51  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
52 
59  virtual void SetSlicePlane(vtkPlane *plane);
60 
62 
68  vtkSetMacro(JumpToNearestSlice, int);
69  vtkBooleanMacro(JumpToNearestSlice, int);
70  vtkGetMacro(JumpToNearestSlice, int);
72 
74 
77  vtkSetMacro(SlabThickness, double);
78  vtkGetMacro(SlabThickness, double);
80 
82 
91  vtkSetClampMacro(SlabType, int, VTK_IMAGE_SLAB_MIN, VTK_IMAGE_SLAB_SUM);
92  vtkGetMacro(SlabType, int);
94  this->SetSlabType(VTK_IMAGE_SLAB_MIN); };
96  this->SetSlabType(VTK_IMAGE_SLAB_MAX); };
98  this->SetSlabType(VTK_IMAGE_SLAB_MEAN); };
100  this->SetSlabType(VTK_IMAGE_SLAB_SUM); };
101  virtual const char *GetSlabTypeAsString();
103 
105 
110  vtkSetClampMacro(SlabSampleFactor, int, 1, 2);
111  vtkGetMacro(SlabSampleFactor, int);
113 
115 
121  vtkSetClampMacro(ImageSampleFactor, int, 1, 16);
122  vtkGetMacro(ImageSampleFactor, int);
124 
126 
130  vtkSetMacro(AutoAdjustImageQuality, int);
131  vtkBooleanMacro(AutoAdjustImageQuality, int);
132  vtkGetMacro(AutoAdjustImageQuality, int);
134 
136 
142  vtkSetMacro(ResampleToScreenPixels, int);
143  vtkBooleanMacro(ResampleToScreenPixels, int);
144  vtkGetMacro(ResampleToScreenPixels, int);
146 
148 
154  vtkSetMacro(SeparateWindowLevelOperation, int);
155  vtkBooleanMacro(SeparateWindowLevelOperation, int);
156  vtkGetMacro(SeparateWindowLevelOperation, int);
158 
160 
164  virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler);
165  virtual vtkAbstractImageInterpolator *GetInterpolator();
167 
171  void Render(vtkRenderer *renderer, vtkImageSlice *prop) VTK_OVERRIDE;
172 
178  void ReleaseGraphicsResources(vtkWindow *) VTK_OVERRIDE;
179 
183  vtkMTimeType GetMTime() VTK_OVERRIDE;
184 
186 
190  double *GetBounds() VTK_OVERRIDE;
191  void GetBounds(double bounds[6]) VTK_OVERRIDE
192  { this->vtkAbstractMapper3D::GetBounds(bounds); };
194 
198  int ProcessRequest(vtkInformation* request,
199  vtkInformationVector** inInfo,
200  vtkInformationVector* outInfo) VTK_OVERRIDE;
201 
202 protected:
204  ~vtkImageResliceMapper() VTK_OVERRIDE;
205 
209  void CheckerboardImage(
210  vtkImageData *input, vtkCamera *camera, vtkImageProperty *property);
211 
215  void UpdateSliceToWorldMatrix(vtkCamera *camera);
216 
221  void UpdateWorldToDataMatrix(vtkImageSlice *prop);
222 
226  void UpdateResliceMatrix(vtkRenderer *ren, vtkImageSlice *prop);
227 
232  void UpdateResliceInformation(vtkRenderer *ren);
233 
237  void UpdateResliceInterpolation(vtkImageProperty *property);
238 
242  void UpdateColorInformation(vtkImageProperty *property);
243 
247  void UpdatePolygonCoords(vtkRenderer *ren);
248 
250 
253  void Update(int port) VTK_OVERRIDE;
254  void Update() VTK_OVERRIDE;
255  int Update(int port, vtkInformationVector* requests) VTK_OVERRIDE;
256  int Update(vtkInformation* requests) VTK_OVERRIDE;
258 
262  void ReportReferences(vtkGarbageCollector*) VTK_OVERRIDE;
263 
264  vtkImageSliceMapper *SliceMapper; // Does the OpenGL rendering
265 
266  int JumpToNearestSlice; // Adjust SliceAtFocalPoint
267  int AutoAdjustImageQuality; // LOD-style behavior
268  int SeparateWindowLevelOperation; // Do window/level as a separate step
269  double SlabThickness; // Current slab thickness
270  int SlabType; // Current slab mode
271  int SlabSampleFactor; // Sampling factor for slab mode
272  int ImageSampleFactor; // Sampling factor for image pixels
273  int ResampleToScreenPixels; // Use software interpolation only
274  int InternalResampleToScreenPixels; // Use software interpolation only
275  int ResliceNeedUpdate; // Execute reslice on next render
276  vtkImageResliceToColors *ImageReslice; // For software interpolation
277  vtkMatrix4x4 *ResliceMatrix; // Cached reslice matrix
278  vtkMatrix4x4 *WorldToDataMatrix; // World to Data transform matrix
279  vtkMatrix4x4 *SliceToWorldMatrix; // Slice to World transform matrix
281 
282 private:
283  vtkImageResliceMapper(const vtkImageResliceMapper&) VTK_DELETE_FUNCTION;
284  void operator=(const vtkImageResliceMapper&) VTK_DELETE_FUNCTION;
285 };
286 
287 #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:35
#define VTK_IMAGE_SLAB_MIN
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
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:32
map scalar values into colors via a lookup table
image display properties
abstract specification for renderers
Definition: vtkRenderer.h:57
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).
void SetSlabTypeToMax()
The slab type, for thick slicing (default: Mean).
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
a simple class to control print indentation
Definition: vtkIndent.h:33
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:44
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop)=0
This should only be called by the renderer.
int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo) override
Handle requests from the pipeline executive.
perform various plane computations
Definition: vtkPlane.h:31
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.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
create a window for renderers to draw into
represents an image in a 3D scene
Definition: vtkImageSlice.h:46
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).
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetSlabTypeToMean()
The slab type, for thick slicing (default: Mean).