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 
115 
117 
120 
122 
130 
132 
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 
152 
154 
156  vtkSetMacro(DisplayText,int);
157  vtkGetMacro(DisplayText,int);
158  vtkBooleanMacro(DisplayText,int);
160 
162 
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);
189 
191 
193  virtual void InitializeReslicePlane();
194  virtual void ResetCamera();
196 
199 
201 
205 
206 protected:
209 
211 
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 
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 
280  void GenerateText();
281 
282 private:
284  void operator=(const vtkResliceCursorRepresentation&); //Not implemented
285 };
286 
287 #endif
vtkWidgetRepresentation.h
vtkResliceCursorRepresentation::BuildRepresentation
virtual void BuildRepresentation()
vtkResliceCursorRepresentation::ImageActor
vtkImageActor * ImageActor
Definition: vtkResliceCursorRepresentation.h:266
vtkPlane
perform various plane computations
Definition: vtkPlane.h:37
vtkResliceCursorRepresentation::SetTextProperty
void SetTextProperty(vtkTextProperty *tprop)
vtkResliceCursorRepresentation::GetTextProperty
vtkTextProperty * GetTextProperty()
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkResliceCursorRepresentation::~vtkResliceCursorRepresentation
~vtkResliceCursorRepresentation()
vtkResliceCursorRepresentation::Texture
vtkTexture * Texture
Definition: vtkResliceCursorRepresentation.h:264
vtkgl::m
const GLfloat * m
Definition: vtkgl.h:18169
vtkResliceCursorRepresentation::UseImageActor
int UseImageActor
Definition: vtkResliceCursorRepresentation.h:275
vtkResliceCursorRepresentation::GetResliceCursor
virtual vtkResliceCursor * GetResliceCursor()=0
vtkResliceCursorRepresentation::RestrictPlaneToVolume
int RestrictPlaneToVolume
Definition: vtkResliceCursorRepresentation.h:255
vtkResliceCursorRepresentation::LookupTable
vtkScalarsToColors * LookupTable
Definition: vtkResliceCursorRepresentation.h:265
vtkResliceCursorRepresentation::NewResliceAxes
vtkMatrix4x4 * NewResliceAxes
Definition: vtkResliceCursorRepresentation.h:261
vtkPlaneSource
create an array of quadrilaterals located in a plane
Definition: vtkPlaneSource.h:60
vtkResliceCursor
Geometry for a reslice cursor.
Definition: vtkResliceCursor.h:46
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:54
vtkInteractionWidgetsModule.h
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkImageMapToColors
map the input image through a lookup table
Definition: vtkImageMapToColors.h:44
vtkResliceCursorRepresentation::SetLookupTable
virtual void SetLookupTable(vtkScalarsToColors *)
vtkResliceCursorRepresentation::SetColorMap
virtual void SetColorMap(vtkImageMapToColors *)
vtkResliceCursorRepresentation::GetVector2
void GetVector2(double d[3])
vtkImageAlgorithm
Generic algorithm superclass for image algs.
Definition: vtkImageAlgorithm.h:40
vtkResliceCursorRepresentation::ResetCamera
virtual void ResetCamera()
vtkResliceCursorRepresentation::InitialLevel
double InitialLevel
Definition: vtkResliceCursorRepresentation.h:273
vtkResliceCursorRepresentation::CreateDefaultLookupTable
vtkScalarsToColors * CreateDefaultLookupTable()
vtkResliceCursorRepresentation::CurrentWindow
double CurrentWindow
Definition: vtkResliceCursorRepresentation.h:270
vtkResliceCursorRepresentation::ColorMap
vtkImageMapToColors * ColorMap
Definition: vtkResliceCursorRepresentation.h:262
vtkResliceCursorRepresentation::PlaneSource
vtkPlaneSource * PlaneSource
Definition: vtkResliceCursorRepresentation.h:254
vtkResliceCursorRepresentation::ActivateText
void ActivateText(int)
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkTexture
handles properties associated with a texture map
Definition: vtkTexture.h:70
vtkResliceCursorRepresentation::GetCursorAlgorithm
virtual vtkResliceCursorPolyDataAlgorithm * GetCursorAlgorithm()=0
vtkResliceCursorRepresentation::GetWorldThicknessLabelPosition
virtual void GetWorldThicknessLabelPosition(double pos[3])
vtkResliceCursorRepresentation::GetThicknessLabelPosition
virtual double * GetThicknessLabelPosition()
vtkTextMapper
2D text annotation
Definition: vtkTextMapper.h:53
vtkResliceCursorRepresentation::ManageTextDisplay
void ManageTextDisplay()
vtkResliceCursorRepresentation::OriginalWindow
double OriginalWindow
Definition: vtkResliceCursorRepresentation.h:268
vtkResliceCursorRepresentation::CreateDefaultResliceAlgorithm
virtual void CreateDefaultResliceAlgorithm()
vtkResliceCursorRepresentation::ManipulationMode
int ManipulationMode
Definition: vtkResliceCursorRepresentation.h:242
vtkResliceCursorRepresentation::GetWindowLevel
void GetWindowLevel(double wl[2])
vtkResliceCursorRepresentation::ThicknessLabelFormat
char * ThicknessLabelFormat
Definition: vtkResliceCursorRepresentation.h:251
vtkResliceCursorPolyDataAlgorithm
generates a 2D reslice cursor polydata
Definition: vtkResliceCursorPolyDataAlgorithm.h:45
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkTextActor
An actor that displays text. Scaled or unscaled.
Definition: vtkTextActor.h:55
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:39
vtkResliceCursorRepresentation::DisplayText
int DisplayText
Definition: vtkResliceCursorRepresentation.h:277
vtkResliceCursorRepresentation::InitializeReslicePlane
virtual void InitializeReslicePlane()
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkImageReslice
Reslices a volume along a new set of axes.
Definition: vtkImageReslice.h:77
vtkResliceCursorRepresentation::SetManipulationMode
void SetManipulationMode(int m)
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkScalarsToColors
Superclass for mapping scalar values to colors.
Definition: vtkScalarsToColors.h:63
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkgl::level
GLint level
Definition: vtkgl.h:11316
vtkResliceCursorRepresentation::GetLevel
double GetLevel()
Definition: vtkResliceCursorRepresentation.h:148
vtkResliceCursorRepresentation::ComputeReslicePlaneOrigin
virtual void ComputeReslicePlaneOrigin()
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:39
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkResliceCursorRepresentation::GetWindow
double GetWindow()
Definition: vtkResliceCursorRepresentation.h:147
vtkResliceCursorRepresentation::InitialWindow
double InitialWindow
Definition: vtkResliceCursorRepresentation.h:272
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkResliceCursorRepresentation::CurrentLevel
double CurrentLevel
Definition: vtkResliceCursorRepresentation.h:271
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:45
vtkResliceCursorRepresentation::ThicknessTextProperty
vtkTextProperty * ThicknessTextProperty
Definition: vtkResliceCursorRepresentation.h:257
VTKINTERACTIONWIDGETS_EXPORT
#define VTKINTERACTIONWIDGETS_EXPORT
Definition: vtkInteractionWidgetsModule.h:15
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkResliceCursorRepresentation::WindowLevel
virtual void WindowLevel(double x, double y)
vtkResliceCursorRepresentation::UpdateReslicePlane
virtual void UpdateReslicePlane()
vtkResliceCursorRepresentation::GenerateText
void GenerateText()
vtkResliceCursorRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkImageActor
draw an image in a rendered 3D scene
Definition: vtkImageActor.h:49
vtkResliceCursorRepresentation::SetWindowLevel
void SetWindowLevel(double window, double level, int copy=0)
vtkResliceCursorRepresentation::Tolerance
int Tolerance
Definition: vtkResliceCursorRepresentation.h:248
vtkResliceCursorRepresentation::ResliceAxes
vtkMatrix4x4 * ResliceAxes
Definition: vtkResliceCursorRepresentation.h:260
vtkResliceCursorRepresentation::ShowReslicedImage
int ShowReslicedImage
Definition: vtkResliceCursorRepresentation.h:256
vtkResliceCursorRepresentation::TextActor
vtkTextActor * TextActor
Definition: vtkResliceCursorRepresentation.h:267
vtkResliceCursorRepresentation::OriginalLevel
double OriginalLevel
Definition: vtkResliceCursorRepresentation.h:269
vtkResliceCursorRepresentation::Modifier
int Modifier
Definition: vtkResliceCursorRepresentation.h:245
vtkResliceCursorRepresentation::ComputeOrigin
virtual void ComputeOrigin(vtkMatrix4x4 *)
vtkResliceCursorRepresentation::TexturePlaneActor
vtkActor * TexturePlaneActor
Definition: vtkResliceCursorRepresentation.h:263
vtkResliceCursorRepresentation::vtkResliceCursorRepresentation
vtkResliceCursorRepresentation()
vtkResliceCursorRepresentation::Reslice
vtkImageAlgorithm * Reslice
Definition: vtkResliceCursorRepresentation.h:253
vtkResliceCursorRepresentation::OnCenter
@ OnCenter
Definition: vtkResliceCursorRepresentation.h:92
vtkResliceCursorRepresentation::RotateBothAxes
@ RotateBothAxes
Definition: vtkResliceCursorRepresentation.h:93
vtkResliceCursorRepresentation::InvertTable
void InvertTable()
vtkResliceCursorRepresentation::GetThicknessLabelText
virtual char * GetThicknessLabelText()
vtkResliceCursorRepresentation
represent the vtkResliceCursorWidget
Definition: vtkResliceCursorRepresentation.h:51
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:259
vtkResliceCursorRepresentation::ThicknessTextMapper
vtkTextMapper * ThicknessTextMapper
Definition: vtkResliceCursorRepresentation.h:258