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 "vtkImageMapper3D.h"
38 
40 class vtkRenderer;
41 class vtkRenderWindow;
42 class vtkCamera;
43 class vtkLookupTable;
44 class vtkImageSlice;
45 class vtkImageData;
47 class vtkMatrix4x4;
49 
51 {
52 public:
53  static vtkImageResliceMapper *New();
55  void PrintSelf(ostream& os, vtkIndent indent);
56 
61  virtual void SetSlicePlane(vtkPlane *plane);
62 
64 
68  vtkSetMacro(JumpToNearestSlice, int);
69  vtkBooleanMacro(JumpToNearestSlice, int);
70  vtkGetMacro(JumpToNearestSlice, int);
72 
74 
75  vtkSetMacro(SlabThickness, double);
76  vtkGetMacro(SlabThickness, double);
78 
80 
81  vtkSetClampMacro(SlabType, int, VTK_IMAGE_SLAB_MIN, VTK_IMAGE_SLAB_MEAN);
82  vtkGetMacro(SlabType, int);
84  this->SetSlabType(VTK_IMAGE_SLAB_MIN); };
86  this->SetSlabType(VTK_IMAGE_SLAB_MAX); };
88  this->SetSlabType(VTK_IMAGE_SLAB_MEAN); };
89  virtual const char *GetSlabTypeAsString();
91 
93 
96  vtkSetClampMacro(SlabSampleFactor, int, 1, 2);
97  vtkGetMacro(SlabSampleFactor, int);
99 
101 
105  vtkSetClampMacro(ImageSampleFactor, int, 1, 16);
106  vtkGetMacro(ImageSampleFactor, int);
108 
110 
112  vtkSetMacro(AutoAdjustImageQuality, int);
113  vtkBooleanMacro(AutoAdjustImageQuality, int);
114  vtkGetMacro(AutoAdjustImageQuality, int);
116 
118 
121  vtkSetMacro(ResampleToScreenPixels, int);
122  vtkBooleanMacro(ResampleToScreenPixels, int);
123  vtkGetMacro(ResampleToScreenPixels, int);
125 
127 
131  vtkSetMacro(SeparateWindowLevelOperation, int);
132  vtkBooleanMacro(SeparateWindowLevelOperation, int);
133  vtkGetMacro(SeparateWindowLevelOperation, int);
135 
137 
139  virtual void SetInterpolator(vtkAbstractImageInterpolator *sampler);
140  virtual vtkAbstractImageInterpolator *GetInterpolator();
142 
144  virtual void Render(vtkRenderer *renderer, vtkImageSlice *prop);
145 
149  virtual void ReleaseGraphicsResources(vtkWindow *);
150 
152  unsigned long GetMTime();
153 
155 
157  double *GetBounds();
158  void GetBounds(double bounds[6])
159  { this->vtkAbstractMapper3D::GetBounds(bounds); };
161 
163 
164  int ProcessRequest(vtkInformation* request,
165  vtkInformationVector** inInfo,
166  vtkInformationVector* outInfo);
168 
169 protected:
172 
174 
175  void CheckerboardImage(
176  vtkImageData *input, vtkCamera *camera, vtkImageProperty *property);
178 
180  void UpdateSliceToWorldMatrix(vtkCamera *camera);
181 
184  void UpdateWorldToDataMatrix(vtkImageSlice *prop);
185 
187  void UpdateResliceMatrix(vtkRenderer *ren, vtkImageSlice *prop);
188 
191  void UpdateResliceInformation(vtkRenderer *ren);
192 
194  void UpdateResliceInterpolation(vtkImageProperty *property);
195 
197  void UpdateColorInformation(vtkImageProperty *property);
198 
200  void UpdatePolygonCoords(vtkRenderer *ren);
201 
203  void Update();
204 
207 
208  vtkImageSliceMapper *SliceMapper; // Does the OpenGL rendering
209 
210  int JumpToNearestSlice; // Adjust SliceAtFocalPoint
211  int AutoAdjustImageQuality; // LOD-style behavior
212  int SeparateWindowLevelOperation; // Do window/level as a separate step
213  double SlabThickness; // Current slab thickness
214  int SlabType; // Current slab mode
215  int SlabSampleFactor; // Sampling factor for slab mode
216  int ImageSampleFactor; // Sampling factor for image pixels
217  int ResampleToScreenPixels; // Use software interpolation only
218  int InternalResampleToScreenPixels; // Use software interpolation only
219  int ResliceNeedUpdate; // Execute reslice on next render
220  vtkImageResliceToColors *ImageReslice; // For software interpolation
221  vtkMatrix4x4 *ResliceMatrix; // Cached reslice matrix
222  vtkMatrix4x4 *WorldToDataMatrix; // World to Data transform matrix
223  vtkMatrix4x4 *SliceToWorldMatrix; // Slice to World transform matrix
225 
226 private:
227  vtkImageResliceMapper(const vtkImageResliceMapper&); // Not implemented.
228  void operator=(const vtkImageResliceMapper&); // Not implemented.
229 };
230 
231 #endif