VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
83  vtkGetMacro(SlabType, int);
85  this->SetSlabType(VTK_IMAGE_SLAB_MIN); };
87  this->SetSlabType(VTK_IMAGE_SLAB_MAX); };
89  this->SetSlabType(VTK_IMAGE_SLAB_MEAN); };
90  virtual const char *GetSlabTypeAsString();
92 
94 
97  vtkSetClampMacro(SlabSampleFactor, int, 1, 2);
98  vtkGetMacro(SlabSampleFactor, int);
100 
102 
106  vtkSetClampMacro(ImageSampleFactor, int, 1, 16);
107  vtkGetMacro(ImageSampleFactor, int);
109 
111 
113  vtkSetMacro(AutoAdjustImageQuality, int);
114  vtkBooleanMacro(AutoAdjustImageQuality, int);
115  vtkGetMacro(AutoAdjustImageQuality, int);
117 
119 
122  vtkSetMacro(ResampleToScreenPixels, int);
123  vtkBooleanMacro(ResampleToScreenPixels, int);
124  vtkGetMacro(ResampleToScreenPixels, int);
126 
128 
132  vtkSetMacro(SeparateWindowLevelOperation, int);
133  vtkBooleanMacro(SeparateWindowLevelOperation, int);
134  vtkGetMacro(SeparateWindowLevelOperation, int);
136 
138 
140  virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler);
141  virtual vtkAbstractImageInterpolator *GetInterpolator();
143 
145  virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop);
146 
150  virtual void ReleaseGraphicsResources(vtkWindow *);
151 
153  unsigned long GetMTime();
154 
156 
158  double *GetBounds();
159  void GetBounds(double bounds[6])
160  { this->vtkAbstractMapper3D::GetBounds(bounds); };
162 
164 
165  int ProcessRequest(vtkInformation* request,
166  vtkInformationVector** inInfo,
167  vtkInformationVector* outInfo);
169 
170 protected:
173 
175 
176  void CheckerboardImage(
177  vtkImageData *input, vtkCamera *camera, vtkImageProperty *property);
179 
181  void UpdateSliceToWorldMatrix(vtkCamera *camera);
182 
185  void UpdateWorldToDataMatrix(vtkImageSlice *prop);
186 
188  void UpdateResliceMatrix(vtkRenderer *ren, vtkImageSlice *prop);
189 
192  void UpdateResliceInformation(vtkRenderer *ren);
193 
195  void UpdateResliceInterpolation(vtkImageProperty *property);
196 
198  void UpdateColorInformation(vtkImageProperty *property);
199 
201  void UpdatePolygonCoords(vtkRenderer *ren);
202 
204 
205  void Update();
206  void Update(int port);
208 
211 
212  vtkImageSliceMapper *SliceMapper; // Does the OpenGL rendering
213 
214  int JumpToNearestSlice; // Adjust SliceAtFocalPoint
215  int AutoAdjustImageQuality; // LOD-style behavior
216  int SeparateWindowLevelOperation; // Do window/level as a separate step
217  double SlabThickness; // Current slab thickness
218  int SlabType; // Current slab mode
219  int SlabSampleFactor; // Sampling factor for slab mode
220  int ImageSampleFactor; // Sampling factor for image pixels
221  int ResampleToScreenPixels; // Use software interpolation only
222  int InternalResampleToScreenPixels; // Use software interpolation only
223  int ResliceNeedUpdate; // Execute reslice on next render
224  vtkImageResliceToColors *ImageReslice; // For software interpolation
225  vtkMatrix4x4 *ResliceMatrix; // Cached reslice matrix
226  vtkMatrix4x4 *WorldToDataMatrix; // World to Data transform matrix
227  vtkMatrix4x4 *SliceToWorldMatrix; // Slice to World transform matrix
229 
230 private:
231  vtkImageResliceMapper(const vtkImageResliceMapper&); // Not implemented.
232  void operator=(const vtkImageResliceMapper&); // Not implemented.
233 };
234 
235 #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.
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
void GetBounds(double bounds[6])
#define VTK_IMAGE_SLAB_MEAN
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
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
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:133
virtual void ReleaseGraphicsResources(vtkWindow *)=0
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
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()
#define vtkBooleanMacro(name, type)
Definition: vtkSetGet.h:234
GLuint sampler
Definition: vtkgl.h:13872
void PrintSelf(ostream &os, vtkIndent indent)
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69