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
33class vtkTextProperty;
34class vtkActor2D;
35class vtkTextMapper;
36class vtkImageData;
37class vtkImageReslice;
38class vtkPlane;
39class vtkPlaneSource;
42class vtkMatrix4x4;
45class vtkActor;
46class vtkImageActor;
47class vtkTexture;
48class vtkTextActor;
50
51class VTKINTERACTIONWIDGETS_EXPORT vtkResliceCursorRepresentation : public vtkWidgetRepresentation
52{
53public:
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
232 virtual void ResetCamera();
234
239
241
245 vtkGetObjectMacro( PlaneSource, vtkPlaneSource );
247
248protected:
251
253
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.
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
298
299 // Selection tolerance for the handles
301
302 // Format for printing the distance
304
326 double LastEventPosition[2];
328 char TextBuff[128];
330
333
334private:
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 char * GetThicknessLabelText()
Get the text shown in the widget's label.
virtual void UpdateReslicePlane()
Update the reslice plane.
void GetVector1(double d[3])
virtual double * GetThicknessLabelPosition()
Get the position of the widget's label in display coordinates.
void GetVector2(double d[3])
virtual void WindowLevel(double x, double y)
Process window level.
virtual vtkResliceCursorPolyDataAlgorithm * GetCursorAlgorithm()=0
Get the underlying cursor source.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual vtkResliceCursor * GetResliceCursor()=0
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 *)
vtkTextProperty * GetTextProperty()
virtual void ComputeReslicePlaneOrigin()
Compute the origin of the planes so as to capture the entire image.
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 void GetThicknessLabelPosition(double pos[3])
virtual void SetResliceParameters(double outputSpacingX, double outputSpacingY, int extentX, int extentY)
virtual void GetWorldThicknessLabelPosition(double pos[3])
vtkScalarsToColors * CreateDefaultLookupTable()
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.