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
vtkWidgetRepresentation.h
vtkResliceCursorRepresentation::BuildRepresentation
virtual void BuildRepresentation()
These are methods that satisfy vtkWidgetRepresentation's API.
vtkResliceCursorRepresentation::ImageActor
vtkImageActor * ImageActor
Definition: vtkResliceCursorRepresentation.h:318
vtkPlane
perform various plane computations
Definition: vtkPlane.h:38
vtkResliceCursorRepresentation::SetTextProperty
void SetTextProperty(vtkTextProperty *tprop)
Set/Get the text property for the image data and window-level annotation.
vtkResliceCursorRepresentation::GetTextProperty
vtkTextProperty * GetTextProperty()
vtkResliceCursorRepresentation::RotateBothAxes
@ RotateBothAxes
Definition: vtkResliceCursorRepresentation.h:104
vtkResliceCursorRepresentation::~vtkResliceCursorRepresentation
~vtkResliceCursorRepresentation()
vtkResliceCursorRepresentation::Texture
vtkTexture * Texture
Definition: vtkResliceCursorRepresentation.h:316
vtkResliceCursorRepresentation::UseImageActor
int UseImageActor
Definition: vtkResliceCursorRepresentation.h:327
vtkResliceCursorRepresentation::GetResliceCursor
virtual vtkResliceCursor * GetResliceCursor()=0
vtkResliceCursorRepresentation::RestrictPlaneToVolume
int RestrictPlaneToVolume
Definition: vtkResliceCursorRepresentation.h:307
vtkResliceCursorRepresentation::LookupTable
vtkScalarsToColors * LookupTable
Definition: vtkResliceCursorRepresentation.h:317
vtkResliceCursorRepresentation::NewResliceAxes
vtkMatrix4x4 * NewResliceAxes
Definition: vtkResliceCursorRepresentation.h:313
vtkPlaneSource
create an array of quadrilaterals located in a plane
Definition: vtkPlaneSource.h:61
vtkResliceCursor
Geometry for a reslice cursor.
Definition: vtkResliceCursor.h:47
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:55
vtkImageMapToColors
map the input image through a lookup table
Definition: vtkImageMapToColors.h:45
vtkResliceCursorRepresentation::SetLookupTable
virtual void SetLookupTable(vtkScalarsToColors *)
Set/Get the internal lookuptable (lut) to one defined by the user, or, alternatively,...
vtkResliceCursorRepresentation::SetColorMap
virtual void SetColorMap(vtkImageMapToColors *)
vtkResliceCursorRepresentation::GetVector2
void GetVector2(double d[3])
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:41
vtkResliceCursorRepresentation::ResetCamera
virtual void ResetCamera()
vtkResliceCursorRepresentation::InitialLevel
double InitialLevel
Definition: vtkResliceCursorRepresentation.h:325
vtkResliceCursorRepresentation::CreateDefaultLookupTable
vtkScalarsToColors * CreateDefaultLookupTable()
vtkResliceCursorRepresentation::CurrentWindow
double CurrentWindow
Definition: vtkResliceCursorRepresentation.h:322
vtkResliceCursorRepresentation::ColorMap
vtkImageMapToColors * ColorMap
Definition: vtkResliceCursorRepresentation.h:314
vtkResliceCursorRepresentation::PlaneSource
vtkPlaneSource * PlaneSource
Definition: vtkResliceCursorRepresentation.h:306
vtkResliceCursorRepresentation::ActivateText
void ActivateText(int)
INTERNAL - Do not use.
vtkX3D::level
@ level
Definition: vtkX3D.h:395
vtkTexture
handles properties associated with a texture map
Definition: vtkTexture.h:71
vtkResliceCursorRepresentation::GetCursorAlgorithm
virtual vtkResliceCursorPolyDataAlgorithm * GetCursorAlgorithm()=0
Get the underlying cursor source.
vtkResliceCursorRepresentation::GetWorldThicknessLabelPosition
virtual void GetWorldThicknessLabelPosition(double pos[3])
vtkResliceCursorRepresentation::GetThicknessLabelPosition
virtual double * GetThicknessLabelPosition()
Get the position of the widget's label in display coordinates.
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:54
vtkResliceCursorRepresentation::ManageTextDisplay
void ManageTextDisplay()
vtkResliceCursorRepresentation::OriginalWindow
double OriginalWindow
Definition: vtkResliceCursorRepresentation.h:320
vtkResliceCursorRepresentation::CreateDefaultResliceAlgorithm
virtual void CreateDefaultResliceAlgorithm()
Create New Reslice plane.
vtkResliceCursorRepresentation::ManipulationMode
int ManipulationMode
The widget sets the manipulation mode.
Definition: vtkResliceCursorRepresentation.h:294
vtkResliceCursorRepresentation::GetWindowLevel
void GetWindowLevel(double wl[2])
vtkResliceCursorRepresentation::ThicknessLabelFormat
char * ThicknessLabelFormat
Definition: vtkResliceCursorRepresentation.h:303
vtkResliceCursorPolyDataAlgorithm
generates a 2D reslice cursor polydata
Definition: vtkResliceCursorPolyDataAlgorithm.h:46
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkTextActor
An actor that displays text.
Definition: vtkTextActor.h:57
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:42
vtkResliceCursorRepresentation::DisplayText
int DisplayText
Definition: vtkResliceCursorRepresentation.h:329
vtkResliceCursorRepresentation::InitializeReslicePlane
virtual void InitializeReslicePlane()
Initialize the reslice planes and the camera center.
vtkImageReslice
Reslices a volume along a new set of axes.
Definition: vtkImageReslice.h:78
vtkResliceCursorRepresentation::SetManipulationMode
void SetManipulationMode(int m)
INTERNAL - Do not use Set the manipulation mode.
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition: vtkScalarsToColors.h:67
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
vtkResliceCursorRepresentation::GetLevel
double GetLevel()
Definition: vtkResliceCursorRepresentation.h:174
vtkResliceCursorRepresentation::ComputeReslicePlaneOrigin
virtual void ComputeReslicePlaneOrigin()
Compute the origin of the planes so as to capture the entire image.
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:40
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkResliceCursorRepresentation::GetWindow
double GetWindow()
Definition: vtkResliceCursorRepresentation.h:173
vtkResliceCursorRepresentation::InitialWindow
double InitialWindow
Definition: vtkResliceCursorRepresentation.h:324
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkResliceCursorRepresentation::CurrentLevel
double CurrentLevel
Definition: vtkResliceCursorRepresentation.h:323
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:46
vtkResliceCursorRepresentation::ThicknessTextProperty
vtkTextProperty * ThicknessTextProperty
Definition: vtkResliceCursorRepresentation.h:309
vtkResliceCursorRepresentation::WindowLevel
virtual void WindowLevel(double x, double y)
Process window level.
vtkResliceCursorRepresentation::UpdateReslicePlane
virtual void UpdateReslicePlane()
Update the reslice plane.
vtkResliceCursorRepresentation::GenerateText
void GenerateText()
vtkResliceCursorRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkImageActor
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:50
vtkResliceCursorRepresentation::SetWindowLevel
void SetWindowLevel(double window, double level, int copy=0)
Set/Get the current window and level values.
vtkResliceCursorRepresentation::Tolerance
int Tolerance
Definition: vtkResliceCursorRepresentation.h:300
vtkResliceCursorRepresentation::ResliceAxes
vtkMatrix4x4 * ResliceAxes
Definition: vtkResliceCursorRepresentation.h:312
vtkResliceCursorRepresentation::ShowReslicedImage
int ShowReslicedImage
Definition: vtkResliceCursorRepresentation.h:308
vtkResliceCursorRepresentation::TextActor
vtkTextActor * TextActor
Definition: vtkResliceCursorRepresentation.h:319
vtkResliceCursorRepresentation::OnCenter
@ OnCenter
Definition: vtkResliceCursorRepresentation.h:103
vtkResliceCursorRepresentation::OriginalLevel
double OriginalLevel
Definition: vtkResliceCursorRepresentation.h:321
vtkResliceCursorRepresentation::Modifier
int Modifier
Definition: vtkResliceCursorRepresentation.h:297
vtkResliceCursorRepresentation::ComputeOrigin
virtual void ComputeOrigin(vtkMatrix4x4 *)
vtkResliceCursorRepresentation::TexturePlaneActor
vtkActor * TexturePlaneActor
Definition: vtkResliceCursorRepresentation.h:315
vtkResliceCursorRepresentation::vtkResliceCursorRepresentation
vtkResliceCursorRepresentation()
vtkResliceCursorRepresentation::Reslice
vtkImageAlgorithm * Reslice
Definition: vtkResliceCursorRepresentation.h:305
vtkResliceCursorRepresentation::InvertTable
void InvertTable()
vtkResliceCursorRepresentation::GetThicknessLabelText
virtual char * GetThicknessLabelText()
Get the text shown in the widget's label.
vtkResliceCursorRepresentation
represent the vtkResliceCursorWidget
Definition: vtkResliceCursorRepresentation.h:52
vtkResliceCursorRepresentation::GetVector1
void GetVector1(double d[3])
vtkResliceCursorRepresentation::GetThicknessLabelPosition
virtual void GetThicknessLabelPosition(double pos[3])
vtkResliceCursorRepresentation::SetResliceParameters
virtual void SetResliceParameters(double outputSpacingX, double outputSpacingY, int extentX, int extentY)
vtkResliceCursorRepresentation::ThicknessTextActor
vtkActor2D * ThicknessTextActor
Definition: vtkResliceCursorRepresentation.h:311
vtkResliceCursorRepresentation::ThicknessTextMapper
vtkTextMapper * ThicknessTextMapper
Definition: vtkResliceCursorRepresentation.h:310