VTK  9.5.20251120
vtkResliceCursorRepresentation.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
17
18#ifndef vtkResliceCursorRepresentation_h
19#define vtkResliceCursorRepresentation_h
20
21#include "vtkInteractionWidgetsModule.h" // For export macro
23#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
24
25VTK_ABI_NAMESPACE_BEGIN
26class vtkTextProperty;
27class vtkActor2D;
28class vtkTextMapper;
29class vtkImageData;
30class vtkImageReslice;
31class vtkPlane;
32class vtkPlaneSource;
35class vtkMatrix4x4;
38class vtkActor;
39class vtkImageActor;
40class vtkTexture;
41class vtkTextActor;
43
44// Private.
45#define VTK_RESLICE_CURSOR_REPRESENTATION_MAX_TEXTBUFF 128
46
47class VTKINTERACTIONWIDGETS_EXPORT VTK_MARSHALAUTO vtkResliceCursorRepresentation
49{
50public:
52
56 void PrintSelf(ostream& os, vtkIndent indent) override;
58
60
65 vtkSetClampMacro(Tolerance, int, 1, 100);
66 vtkGetMacro(Tolerance, int);
68
70
75 vtkBooleanMacro(ShowReslicedImage, vtkTypeBool);
77
79
87
89
94 void SetThicknessLabelFormat(const char* format);
95 vtkGetStringMacro(ThicknessLabelFormat);
97
98 // Used to communicate about the state of the representation
99 enum
100 {
108 };
109 enum
110 {
111 None = 0,
117 };
118
122 virtual char* GetThicknessLabelText();
123
125
128 virtual double* GetThicknessLabelPosition();
129 virtual void GetThicknessLabelPosition(double pos[3]);
130 virtual void GetWorldThicknessLabelPosition(double pos[3]);
132
136 void BuildRepresentation() override;
137
139
142 vtkGetObjectMacro(ResliceAxes, vtkMatrix4x4);
143 vtkGetObjectMacro(Reslice, vtkImageAlgorithm);
145
147
150 vtkGetObjectMacro(ImageActor, vtkImageActor);
152
154
162 vtkGetObjectMacro(LookupTable, vtkScalarsToColors);
164
166
173 vtkGetObjectMacro(ColorMap, vtkImageMapToColors);
177
179
185 void SetWindowLevel(double window, double level, int copy = 0);
186 void GetWindowLevel(double wl[2]);
187 double GetWindow() { return this->CurrentWindow; }
188 double GetLevel() { return this->CurrentLevel; }
190
193
195
201 vtkBooleanMacro(DisplayText, vtkTypeBool);
203
205
211
213
219 vtkBooleanMacro(UseImageActor, vtkTypeBool);
221
223
227 vtkSetMacro(IndependentThickness, bool);
228 vtkGetMacro(IndependentThickness, bool);
229 vtkBooleanMacro(IndependentThickness, bool);
231
233
238 vtkGetMacro(ManipulationMode, int);
240
242
247 void ActivateText(int);
250
252
257 virtual void ResetCamera();
259
264
266
271 vtkGetObjectMacro(PlaneSource, vtkPlaneSource);
273
279 static int BoundPlane(double bounds[6], double origin[3], double p1[3], double p2[3]);
286 static void TransformPlane(vtkPlaneSource* planeToTransform, double targetCenter[3],
287 double targetNormal[3], double targetViewUp[3]);
288
289protected:
292
294
300 double outputSpacingX, double outputSpacingY, int extentX, int extentY);
302
306 virtual void WindowLevel(double x, double y);
307
311 virtual void UpdateReslicePlane();
312
317
318 // for negative window values.
320
321 // recompute origin to make the location of the reslice cursor consistent
322 // with its physical location
324
326 void GetVector1(double d[3]);
327 void GetVector2(double d[3]);
329
335
336 // Keep track if modifier is set
338
339 // Selection tolerance for the handles
341
342 // Format for printing the distance
344
371
374
375private:
377 void operator=(const vtkResliceCursorRepresentation&) = delete;
378};
379
380VTK_ABI_NAMESPACE_END
381#endif
a actor that draws 2D data
Definition vtkActor2D.h:145
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
draw an image in a rendered 3D scene
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:108
represent and manipulate 4x4 transformation matrices
create an array of quadrilaterals located in a plane
perform various plane computations
Definition vtkPlane.h:141
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.
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.
void SetThicknessLabelFormat(const char *format)
Specify the std::formay style format to use for labelling the distance.
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:168
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_RESLICE_CURSOR_REPRESENTATION_MAX_TEXTBUFF
#define VTK_MARSHAL_EXCLUDE_REASON_IS_REDUNDANT
#define VTK_MARSHAL_EXCLUDE_REASON_IS_INTERNAL
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)
#define vtkImageAlgorithm