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 =========================================================================*/
34 #ifndef vtkImageResliceMapper_h
35 #define vtkImageResliceMapper_h
36 
37 #include "vtkRenderingImageModule.h" // For export macro
38 #include "vtkImageMapper3D.h"
39 
41 class vtkRenderer;
42 class vtkRenderWindow;
43 class vtkCamera;
44 class vtkLookupTable;
45 class vtkImageSlice;
46 class vtkImageData;
48 class vtkMatrix4x4;
50 
52 {
53 public:
54  static vtkImageResliceMapper *New();
56  void PrintSelf(ostream& os, vtkIndent indent);
57 
62  virtual void SetSlicePlane(vtkPlane *plane);
63 
65 
69  vtkSetMacro(JumpToNearestSlice, int);
70  vtkBooleanMacro(JumpToNearestSlice, int);
71  vtkGetMacro(JumpToNearestSlice, int);
73 
75 
76  vtkSetMacro(SlabThickness, double);
77  vtkGetMacro(SlabThickness, double);
79 
81 
88  vtkSetClampMacro(SlabType, int, VTK_IMAGE_SLAB_MIN, VTK_IMAGE_SLAB_SUM);
89  vtkGetMacro(SlabType, int);
91  this->SetSlabType(VTK_IMAGE_SLAB_MIN); };
93  this->SetSlabType(VTK_IMAGE_SLAB_MAX); };
95  this->SetSlabType(VTK_IMAGE_SLAB_MEAN); };
97  this->SetSlabType(VTK_IMAGE_SLAB_SUM); };
98  virtual const char *GetSlabTypeAsString();
100 
102 
105  vtkSetClampMacro(SlabSampleFactor, int, 1, 2);
106  vtkGetMacro(SlabSampleFactor, int);
108 
110 
114  vtkSetClampMacro(ImageSampleFactor, int, 1, 16);
115  vtkGetMacro(ImageSampleFactor, int);
117 
119 
121  vtkSetMacro(AutoAdjustImageQuality, int);
122  vtkBooleanMacro(AutoAdjustImageQuality, int);
123  vtkGetMacro(AutoAdjustImageQuality, int);
125 
127 
130  vtkSetMacro(ResampleToScreenPixels, int);
131  vtkBooleanMacro(ResampleToScreenPixels, int);
132  vtkGetMacro(ResampleToScreenPixels, int);
134 
136 
140  vtkSetMacro(SeparateWindowLevelOperation, int);
141  vtkBooleanMacro(SeparateWindowLevelOperation, int);
142  vtkGetMacro(SeparateWindowLevelOperation, int);
144 
146 
148  virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler);
149  virtual vtkAbstractImageInterpolator *GetInterpolator();
151 
153  virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop);
154 
158  virtual void ReleaseGraphicsResources(vtkWindow *);
159 
161  unsigned long GetMTime();
162 
164 
166  double *GetBounds();
167  void GetBounds(double bounds[6])
168  { this->vtkAbstractMapper3D::GetBounds(bounds); };
170 
172 
173  int ProcessRequest(vtkInformation* request,
174  vtkInformationVector** inInfo,
175  vtkInformationVector* outInfo);
177 
178 protected:
181 
183 
184  void CheckerboardImage(
185  vtkImageData *input, vtkCamera *camera, vtkImageProperty *property);
187 
189  void UpdateSliceToWorldMatrix(vtkCamera *camera);
190 
193  void UpdateWorldToDataMatrix(vtkImageSlice *prop);
194 
196  void UpdateResliceMatrix(vtkRenderer *ren, vtkImageSlice *prop);
197 
200  void UpdateResliceInformation(vtkRenderer *ren);
201 
203  void UpdateResliceInterpolation(vtkImageProperty *property);
204 
206  void UpdateColorInformation(vtkImageProperty *property);
207 
209  void UpdatePolygonCoords(vtkRenderer *ren);
210 
212 
213  void Update();
214  void Update(int port);
216 
219 
220  vtkImageSliceMapper *SliceMapper; // Does the OpenGL rendering
221 
222  int JumpToNearestSlice; // Adjust SliceAtFocalPoint
223  int AutoAdjustImageQuality; // LOD-style behavior
224  int SeparateWindowLevelOperation; // Do window/level as a separate step
225  double SlabThickness; // Current slab thickness
226  int SlabType; // Current slab mode
227  int SlabSampleFactor; // Sampling factor for slab mode
228  int ImageSampleFactor; // Sampling factor for image pixels
229  int ResampleToScreenPixels; // Use software interpolation only
230  int InternalResampleToScreenPixels; // Use software interpolation only
231  int ResliceNeedUpdate; // Execute reslice on next render
232  vtkImageResliceToColors *ImageReslice; // For software interpolation
233  vtkMatrix4x4 *ResliceMatrix; // Cached reslice matrix
234  vtkMatrix4x4 *WorldToDataMatrix; // World to Data transform matrix
235  vtkMatrix4x4 *SliceToWorldMatrix; // Slice to World transform matrix
237 
238 private:
239  vtkImageResliceMapper(const vtkImageResliceMapper&); // Not implemented.
240  void operator=(const vtkImageResliceMapper&); // Not implemented.
241 };
242 
243 #endif
interpolate data values from images
virtual unsigned long GetMTime()
#define VTK_IMAGE_SLAB_MAX
Reslice and produce color scalars.
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:38
#define VTK_IMAGE_SLAB_MIN
Store vtkAlgorithm input/output information.
void GetBounds(double bounds[6])
#define VTK_IMAGE_SLAB_SUM
#define VTK_IMAGE_SLAB_MEAN
record modification and/or execution time
Definition: vtkTimeStamp.h:34
map scalar values into colors via a lookup table
image display properties
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkImageResliceToColors * ImageReslice
virtual void ReleaseGraphicsResources(vtkWindow *)=0
Detect and break reference loops.
virtual void ReportReferences(vtkGarbageCollector *)
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
#define VTKRENDERINGIMAGE_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
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:48
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop)=0
perform various plane computations
Definition: vtkPlane.h:36
vtkImageSliceMapper * SliceMapper
virtual double * GetBounds()=0
virtual void Update()
create a window for renderers to draw into
virtual int ProcessRequest(vtkInformation *request, vtkInformationVector **inInfo, vtkInformationVector *outInfo)
represents an image in a 3D scene
Definition: vtkImageSlice.h:51
Store zero or more vtkInformation instances.
map a slice of a vtkImageData to the screen
static vtkAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)