VTK  9.2.6
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=========================================================================*/
29
30#ifndef vtkResliceCursorRepresentation_h
31#define vtkResliceCursorRepresentation_h
32
33#include "vtkInteractionWidgetsModule.h" // For export macro
35
36class vtkTextProperty;
37class vtkActor2D;
38class vtkTextMapper;
39class vtkImageData;
40class vtkImageReslice;
41class vtkPlane;
42class vtkPlaneSource;
45class vtkMatrix4x4;
48class vtkActor;
49class vtkImageActor;
50class vtkTexture;
51class vtkTextActor;
53
54// Private.
55#define VTK_RESLICE_CURSOR_REPRESENTATION_MAX_TEXTBUFF 128
56
57class VTKINTERACTIONWIDGETS_EXPORT vtkResliceCursorRepresentation : public vtkWidgetRepresentation
58{
59public:
61
65 void PrintSelf(ostream& os, vtkIndent indent) override;
67
69
74 vtkSetClampMacro(Tolerance, int, 1, 100);
75 vtkGetMacro(Tolerance, int);
77
79
84 vtkBooleanMacro(ShowReslicedImage, vtkTypeBool);
86
88
96
98
103 vtkSetStringMacro(ThicknessLabelFormat);
104 vtkGetStringMacro(ThicknessLabelFormat);
106
107 // Used to communicate about the state of the representation
108 enum
109 {
117 };
118 enum
119 {
120 None = 0,
126 };
127
131 virtual char* GetThicknessLabelText();
132
134
137 virtual double* GetThicknessLabelPosition();
138 virtual void GetThicknessLabelPosition(double pos[3]);
139 virtual void GetWorldThicknessLabelPosition(double pos[3]);
141
145 void BuildRepresentation() override;
146
148
151 vtkGetObjectMacro(ResliceAxes, vtkMatrix4x4);
152 vtkGetObjectMacro(Reslice, vtkImageAlgorithm);
154
156
159 vtkGetObjectMacro(ImageActor, vtkImageActor);
161
163
171 vtkGetObjectMacro(LookupTable, vtkScalarsToColors);
173
175
181 vtkGetObjectMacro(ColorMap, vtkImageMapToColors);
184
186
192 void SetWindowLevel(double window, double level, int copy = 0);
193 void GetWindowLevel(double wl[2]);
194 double GetWindow() { return this->CurrentWindow; }
195 double GetLevel() { return this->CurrentLevel; }
197
199
201
207 vtkBooleanMacro(DisplayText, vtkTypeBool);
209
211
217
219
225 vtkBooleanMacro(UseImageActor, vtkTypeBool);
227
229
234 vtkGetMacro(ManipulationMode, int);
236
238
243 void ActivateText(int);
246
248
253 virtual void ResetCamera();
255
260
262
266 vtkGetObjectMacro(PlaneSource, vtkPlaneSource);
268
274 static int BoundPlane(double bounds[6], double origin[3], double p1[3], double p2[3]);
281 static void TransformPlane(vtkPlaneSource* planeToTransform, double targetCenter[3],
282 double targetNormal[3], double targetViewUp[3]);
283
284protected:
287
289
295 double outputSpacingX, double outputSpacingY, int extentX, int extentY);
297
301 virtual void WindowLevel(double x, double y);
302
306 virtual void UpdateReslicePlane();
307
312
313 // for negative window values.
315
316 // recompute origin to make the location of the reslice cursor consistent
317 // with its physical location
319
321 void GetVector1(double d[3]);
322 void GetVector2(double d[3]);
324
330
331 // Keep track if modifier is set
333
334 // Selection tolerance for the handles
336
337 // Format for printing the distance
339
365
368
369private:
371 void operator=(const vtkResliceCursorRepresentation&) = delete;
372};
373
374#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
Generic algorithm superclass for image algs.
topologically and geometrically regular array of data
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
create an array of quadrilaterals located in a plane
perform various plane computations
Definition vtkPlane.h:37
generates a 2D reslice cursor polydata
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.
double GetLevel()
Set/Get the current window and level values.
~vtkResliceCursorRepresentation() override
double GetWindow()
Set/Get the current window and level values.
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])
void PrintSelf(ostream &os, vtkIndent indent) override
Standard VTK methods.
virtual void WindowLevel(double x, double y)
Process window level.
virtual vtkResliceCursorPolyDataAlgorithm * GetCursorAlgorithm()=0
Get the underlying cursor source.
void ManageTextDisplay()
INTERNAL - Do not use.
static void TransformPlane(vtkPlaneSource *planeToTransform, double targetCenter[3], double targetNormal[3], double targetViewUp[3])
First rotate planeToTransform to match targetPlane normal.
virtual vtkResliceCursor * GetResliceCursor()=0
char TextBuff[VTK_RESLICE_CURSOR_REPRESENTATION_MAX_TEXTBUFF]
static int BoundPlane(double bounds[6], double origin[3], double p1[3], double p2[3])
Fit the plane defined by origin, p1, p2 onto the bounds.
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])
Set/Get the current window and level values.
virtual void ResetCamera()
Initialize the reslice planes and the camera center.
virtual void SetColorMap(vtkImageMapToColors *)
Convenience method to get the vtkImageMapToColors filter used by this widget.
vtkTextProperty * GetTextProperty()
Set/Get the text property for the image data and window-level annotation.
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.
void BuildRepresentation() override
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void SetLookupTable(vtkScalarsToColors *)
Set/Get the internal lookuptable (lut) to one defined by the user, or, alternatively,...
virtual void GetThicknessLabelPosition(double pos[3])
Get the position of the widget's label in display coordinates.
virtual void SetResliceParameters(double outputSpacingX, double outputSpacingY, int extentX, int extentY)
Create New Reslice plane.
virtual void GetWorldThicknessLabelPosition(double pos[3])
Get the position of the widget's label in display coordinates.
vtkScalarsToColors * CreateDefaultLookupTable()
Geometry for a reslice cursor.
Superclass for mapping scalar values to colors.
An actor that displays text.
2D text annotation
represent text properties.
handles properties associated with a texture map
Definition vtkTexture.h:69
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_RESLICE_CURSOR_REPRESENTATION_MAX_TEXTBUFF