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 =========================================================================*/
27 #ifndef vtkResliceCursorRepresentation_h
28 #define vtkResliceCursorRepresentation_h
29 
30 #include "vtkInteractionWidgetsModule.h" // For export macro
32 
33 class vtkTextProperty;
34 class vtkActor2D;
35 class vtkTextMapper;
36 class vtkImageData;
37 class vtkImageReslice;
38 class vtkPlane;
39 class vtkPlaneSource;
41 class vtkResliceCursor;
42 class vtkMatrix4x4;
43 class vtkScalarsToColors;
45 class vtkActor;
46 class vtkImageActor;
47 class vtkTexture;
48 class vtkTextActor;
49 class vtkImageAlgorithm;
50 
51 class VTKINTERACTIONWIDGETS_EXPORT vtkResliceCursorRepresentation : public vtkWidgetRepresentation
52 {
53 public:
55 
59  void PrintSelf(ostream& os, vtkIndent indent);
61 
63 
68  vtkSetClampMacro(Tolerance,int,1,100);
69  vtkGetMacro(Tolerance,int);
71 
73 
76  vtkSetMacro( ShowReslicedImage, int );
77  vtkGetMacro( ShowReslicedImage, int );
78  vtkBooleanMacro( ShowReslicedImage, int );
80 
82 
86  vtkSetMacro(RestrictPlaneToVolume,int);
87  vtkGetMacro(RestrictPlaneToVolume,int);
88  vtkBooleanMacro(RestrictPlaneToVolume,int);
90 
92 
97  vtkSetStringMacro(ThicknessLabelFormat);
98  vtkGetStringMacro(ThicknessLabelFormat);
100 
101  // Used to communicate about the state of the representation
102  enum { Outside=0, NearCenter, NearAxis1, NearAxis2,
103  OnCenter, OnAxis1, OnAxis2};
104  enum { None=0, PanAndRotate, RotateBothAxes,
105  ResizeThickness, WindowLevelling };
106 
110  virtual char* GetThicknessLabelText();
111 
113 
116  virtual double* GetThicknessLabelPosition();
117  virtual void GetThicknessLabelPosition(double pos[3]);
118  virtual void GetWorldThicknessLabelPosition(double pos[3]);
120 
124  virtual void BuildRepresentation();
125 
127 
130  vtkGetObjectMacro( ResliceAxes, vtkMatrix4x4 );
131  vtkGetObjectMacro( Reslice, vtkImageAlgorithm );
133 
135 
138  vtkGetObjectMacro( ImageActor, vtkImageActor );
140 
142 
150  vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
152 
154 
160  vtkGetObjectMacro(ColorMap, vtkImageMapToColors);
163 
165 
171  void SetWindowLevel(double window, double level, int copy = 0);
172  void GetWindowLevel(double wl[2]);
173  double GetWindow(){return this->CurrentWindow;}
174  double GetLevel(){return this->CurrentLevel;}
176 
178 
180 
184  vtkSetMacro(DisplayText,int);
185  vtkGetMacro(DisplayText,int);
186  vtkBooleanMacro(DisplayText,int);
188 
190 
196 
198 
202  vtkSetMacro( UseImageActor, int );
203  vtkGetMacro( UseImageActor, int );
204  vtkBooleanMacro( UseImageActor, int );
206 
208 
212  void SetManipulationMode( int m );
213  vtkGetMacro(ManipulationMode, int);
215 
217 
222  void ActivateText(int);
225 
227 
231  virtual void InitializeReslicePlane();
232  virtual void ResetCamera();
234 
239 
241 
245  vtkGetObjectMacro( PlaneSource, vtkPlaneSource );
247 
248 protected:
251 
253 
258  virtual void SetResliceParameters(
259  double outputSpacingX, double outputSpacingY,
260  int extentX, int extentY );
262 
266  virtual void WindowLevel( double x, double y );
267 
271  virtual void UpdateReslicePlane();
272 
277 
278  // for negative window values.
279  void InvertTable();
280 
281  // recompute origin to make the location of the reslice cursor consistent
282  // with its physical location
283  virtual void ComputeOrigin( vtkMatrix4x4 * );
284 
286  void GetVector1( double d[3] );
287  void GetVector2( double d[3] );
289 
295 
296  // Keep track if modifier is set
297  int Modifier;
298 
299  // Selection tolerance for the handles
301 
302  // Format for printing the distance
304 
323  double CurrentLevel;
325  double InitialLevel;
326  double LastEventPosition[2];
328  char TextBuff[128];
330 
332  void GenerateText();
333 
334 private:
336  void operator=(const vtkResliceCursorRepresentation&) VTK_DELETE_FUNCTION;
337 };
338 
339 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:46
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:50
Generic algorithm superclass for image algs.
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
map the input image through a lookup table
Reslices a volume along a new set of axes.
a simple class to control print indentation
Definition: vtkIndent.h:40
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:42
create an array of quadrilaterals located in a plane
perform various plane computations
Definition: vtkPlane.h:38
generates a 2D reslice cursor polydata
represent the vtkResliceCursorWidget
int ManipulationMode
The widget sets the manipulation mode.
virtual void InitializeReslicePlane()
Initialize the reslice planes and the camera center.
virtual void UpdateReslicePlane()
Update the reslice plane.
void GetVector1(double d[3])
void GetVector2(double d[3])
virtual void WindowLevel(double x, double y)
Process window level.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkTextProperty * GetTextProperty()
virtual vtkResliceCursorPolyDataAlgorithm * GetCursorAlgorithm()=0
Get the underlying cursor source.
virtual char * GetThicknessLabelText()
Get the text shown in the widget's label.
virtual void ComputeOrigin(vtkMatrix4x4 *)
void SetManipulationMode(int m)
INTERNAL - Do not use Set the manipulation mode.
void SetWindowLevel(double window, double level, int copy=0)
Set/Get the current window and level values.
virtual void CreateDefaultResliceAlgorithm()
Create New Reslice plane.
void GetWindowLevel(double wl[2])
virtual void BuildRepresentation()
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void SetColorMap(vtkImageMapToColors *)
virtual void ComputeReslicePlaneOrigin()
Compute the origin of the planes so as to capture the entire image.
virtual vtkResliceCursor * GetResliceCursor()=0
void SetTextProperty(vtkTextProperty *tprop)
Set/Get the text property for the image data and window-level annotation.
void ActivateText(int)
INTERNAL - Do not use.
virtual void SetLookupTable(vtkScalarsToColors *)
Set/Get the internal lookuptable (lut) to one defined by the user, or, alternatively,...
virtual double * GetThicknessLabelPosition()
Get the position of the widget's label in display coordinates.
virtual void GetThicknessLabelPosition(double pos[3])
vtkScalarsToColors * CreateDefaultLookupTable()
virtual void SetResliceParameters(double outputSpacingX, double outputSpacingY, int extentX, int extentY)
virtual void GetWorldThicknessLabelPosition(double pos[3])
Geometry for a reslice cursor.
Superclass for mapping scalar values to colors.
An actor that displays text.
Definition: vtkTextActor.h:57
2D text annotation
Definition: vtkTextMapper.h:54
represent text properties.
handles properties associated with a texture map
Definition: vtkTexture.h:71
abstract class defines interface between the widget and widget representation classes
@ level
Definition: vtkX3D.h:395
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.