VTK
vtkResliceCursorRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkResliceCursorRepresentation.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 =========================================================================*/
26 #ifndef vtkResliceCursorRepresentation_h
27 #define vtkResliceCursorRepresentation_h
28 
29 #include "vtkInteractionWidgetsModule.h" // For export macro
31 
32 class vtkTextProperty;
33 class vtkActor2D;
34 class vtkTextMapper;
35 class vtkImageData;
36 class vtkImageReslice;
37 class vtkPlane;
38 class vtkPlaneSource;
40 class vtkResliceCursor;
41 class vtkMatrix4x4;
42 class vtkScalarsToColors;
44 class vtkActor;
45 class vtkImageActor;
46 class vtkTexture;
47 class vtkTextActor;
48 class vtkImageAlgorithm;
49 
51 {
52 public:
54 
56  void PrintSelf(ostream& os, vtkIndent indent);
58 
60 
63  vtkSetClampMacro(Tolerance,int,1,100);
64  vtkGetMacro(Tolerance,int);
66 
68 
69  vtkSetMacro( ShowReslicedImage, int );
70  vtkGetMacro( ShowReslicedImage, int );
71  vtkBooleanMacro( ShowReslicedImage, int );
73 
75 
77  vtkSetMacro(RestrictPlaneToVolume,int);
78  vtkGetMacro(RestrictPlaneToVolume,int);
79  vtkBooleanMacro(RestrictPlaneToVolume,int);
81 
83 
86  vtkSetStringMacro(ThicknessLabelFormat);
87  vtkGetStringMacro(ThicknessLabelFormat);
89 
90  // Used to communicate about the state of the representation
91  enum { Outside=0, NearCenter, NearAxis1, NearAxis2,
92  OnCenter, OnAxis1, OnAxis2};
93  enum { None=0, PanAndRotate, RotateBothAxes,
94  ResizeThickness, WindowLevelling };
95 
97  virtual char* GetThicknessLabelText();
98 
100 
101  virtual double* GetThicknessLabelPosition();
102  virtual void GetThicknessLabelPosition(double pos[3]);
103  virtual void GetWorldThicknessLabelPosition(double pos[3]);
105 
107  virtual void BuildRepresentation();
108 
110 
111  vtkGetObjectMacro( ResliceAxes, vtkMatrix4x4 );
112  vtkGetObjectMacro( Reslice, vtkImageAlgorithm );
114 
116 
117  vtkGetObjectMacro( ImageActor, vtkImageActor );
119 
121 
126  virtual void SetLookupTable(vtkScalarsToColors*);
127  vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
129 
131 
135  vtkGetObjectMacro(ColorMap, vtkImageMapToColors);
136  virtual void SetColorMap(vtkImageMapToColors *);
138 
140 
144  void SetWindowLevel(double window, double level, int copy = 0);
145  void GetWindowLevel(double wl[2]);
146  double GetWindow(){return this->CurrentWindow;}
147  double GetLevel(){return this->CurrentLevel;}
149 
150  virtual vtkResliceCursor * GetResliceCursor() = 0;
151 
153 
155  vtkSetMacro(DisplayText,int);
156  vtkGetMacro(DisplayText,int);
157  vtkBooleanMacro(DisplayText,int);
159 
161 
163  void SetTextProperty(vtkTextProperty* tprop);
164  vtkTextProperty* GetTextProperty();
166 
168 
170  vtkSetMacro( UseImageActor, int );
171  vtkGetMacro( UseImageActor, int );
172  vtkBooleanMacro( UseImageActor, int );
174 
176 
178  void SetManipulationMode( int m );
179  vtkGetMacro(ManipulationMode, int);
181 
183 
185  void ActivateText(int);
186  void ManageTextDisplay();
188 
190 
192  virtual void InitializeReslicePlane();
193  virtual void ResetCamera();
195 
197  virtual vtkResliceCursorPolyDataAlgorithm * GetCursorAlgorithm() = 0;
198 
200 
202  vtkGetObjectMacro( PlaneSource, vtkPlaneSource );
204 
205 protected:
208 
210 
212  virtual void CreateDefaultResliceAlgorithm();
213  virtual void SetResliceParameters(
214  double outputSpacingX, double outputSpacingY,
215  int extentX, int extentY );
217 
219  virtual void WindowLevel( double x, double y );
220 
222  virtual void UpdateReslicePlane();
223 
225  virtual void ComputeReslicePlaneOrigin();
226 
227  // for negative window values.
228  void InvertTable();
229 
230  // recompute origin to make the location of the reslice cursor consistent
231  // with its physical location
232  virtual void ComputeOrigin( vtkMatrix4x4 * );
233 
235  void GetVector1( double d[3] );
236  void GetVector2( double d[3] );
238 
242 
243  // Keep track if modifier is set
244  int Modifier;
245 
246  // Selection tolerance for the handles
248 
249  // Format for printing the distance
251 
270  double CurrentLevel;
272  double InitialLevel;
273  double LastEventPosition[2];
275  char TextBuff[128];
277 
278  vtkScalarsToColors * CreateDefaultLookupTable();
279  void GenerateText();
280 
281 private:
283  void operator=(const vtkResliceCursorRepresentation&); //Not implemented
284 };
285 
286 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:50
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:38
generates a 2D reslice cursor polydata
a actor that draws 2D data
Definition: vtkActor2D.h:44
abstract class defines interface between the widget and widget representation classes ...
virtual void BuildRepresentation()=0
2D text annotation
Definition: vtkTextMapper.h:52
Superclass for mapping scalar values to colors.
#define VTKINTERACTIONWIDGETS_EXPORT
An actor that displays text. Scaled or unscaled.
Definition: vtkTextActor.h:54
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:48
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
perform various plane computations
Definition: vtkPlane.h:36
map the input image through a lookup table
handles properties associated with a texture map
Definition: vtkTexture.h:69
represent text properties.
Reslices a volume along a new set of axes.
create an array of quadrilaterals located in a plane
Generic algorithm superclass for image algs.
void PrintSelf(ostream &os, vtkIndent indent)
represent the vtkResliceCursorWidget
Geometry for a reslice cursor.