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 //BTX -- 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 //ETX
96 
98  virtual char* GetThicknessLabelText();
99 
101 
102  virtual double* GetThicknessLabelPosition();
103  virtual void GetThicknessLabelPosition(double pos[3]);
104  virtual void GetWorldThicknessLabelPosition(double pos[3]);
106 
108  virtual void BuildRepresentation();
109 
111 
112  vtkGetObjectMacro( ResliceAxes, vtkMatrix4x4 );
113  vtkGetObjectMacro( Reslice, vtkImageAlgorithm );
115 
117 
118  vtkGetObjectMacro( ImageActor, vtkImageActor );
120 
122 
127  virtual void SetLookupTable(vtkScalarsToColors*);
128  vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
130 
132 
136  vtkGetObjectMacro(ColorMap, vtkImageMapToColors);
137  virtual void SetColorMap(vtkImageMapToColors *);
139 
141 
145  void SetWindowLevel(double window, double level, int copy = 0);
146  void GetWindowLevel(double wl[2]);
147  double GetWindow(){return this->CurrentWindow;}
148  double GetLevel(){return this->CurrentLevel;}
150 
151  virtual vtkResliceCursor * GetResliceCursor() = 0;
152 
154 
156  vtkSetMacro(DisplayText,int);
157  vtkGetMacro(DisplayText,int);
158  vtkBooleanMacro(DisplayText,int);
160 
162 
164  void SetTextProperty(vtkTextProperty* tprop);
165  vtkTextProperty* GetTextProperty();
167 
169 
171  vtkSetMacro( UseImageActor, int );
172  vtkGetMacro( UseImageActor, int );
173  vtkBooleanMacro( UseImageActor, int );
175 
177 
179  void SetManipulationMode( int m );
180  vtkGetMacro(ManipulationMode, int);
182 
184 
186  void ActivateText(int);
187  void ManageTextDisplay();
189 
191 
193  virtual void InitializeReslicePlane();
194  virtual void ResetCamera();
196 
198  virtual vtkResliceCursorPolyDataAlgorithm * GetCursorAlgorithm() = 0;
199 
201 
203  vtkGetObjectMacro( PlaneSource, vtkPlaneSource );
205 
206 protected:
209 
211 
213  virtual void CreateDefaultResliceAlgorithm();
214  virtual void SetResliceParameters(
215  double outputSpacingX, double outputSpacingY,
216  int extentX, int extentY );
218 
220  virtual void WindowLevel( double x, double y );
221 
223  virtual void UpdateReslicePlane();
224 
226  virtual void ComputeReslicePlaneOrigin();
227 
228  // for negative window values.
229  void InvertTable();
230 
231  // recompute origin to make the location of the reslice cursor consistent
232  // with its physical location
233  virtual void ComputeOrigin( vtkMatrix4x4 * );
234 
236  void GetVector1( double d[3] );
237  void GetVector2( double d[3] );
239 
243 
244  // Keep track if modifier is set
245  int Modifier;
246 
247  // Selection tolerance for the handles
249 
250  // Format for printing the distance
252 
271  double CurrentLevel;
273  double InitialLevel;
274  double LastEventPosition[2];
276  char TextBuff[128];
278 
279  vtkScalarsToColors * CreateDefaultLookupTable();
280  void GenerateText();
281 
282 private:
284  void operator=(const vtkResliceCursorRepresentation&); //Not implemented
285 };
286 
287 #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.