Slicer 5.6
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkSlicerROIRepresentation3D.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4 Queen's University, Kingston, ON, Canada. All Rights Reserved.
5
6 See COPYRIGHT.txt
7 or http://www.slicer.org/copyright/copyright.txt for details.
8
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14
15 This file was originally developed by Kyle Sunderland, PerkLab, Queen's University
16 and was supported through CANARIE's Research Software Program, Cancer
17 Care Ontario, OpenAnatomy, and Brigham and Women's Hospital through NIH grant R01MH112748.
18
19==============================================================================*/
20
32#ifndef vtkSlicerROIRepresentation3D_h
33#define vtkSlicerROIRepresentation3D_h
34
35#include "vtkSlicerMarkupsModuleVTKWidgetsExport.h"
37
38class vtkActor;
39class vtkArrayCalculator;
40class vtkAppendPolyData;
41class vtkArrowSource;
42class vtkGlyph3DMapper;
43class vtkLookupTable;
46class vtkOutlineFilter;
47class vtkPassThrough;
48class vtkPlaneSource;
49class vtkPolyDataAlgorithm;
50class vtkPolyDataMapper;
51class vtkPolyData;
52class vtkTransformPolyDataFilter;
53class vtkTubeFilter;
54
55class VTK_SLICER_MARKUPS_MODULE_VTKWIDGETS_EXPORT vtkSlicerROIRepresentation3D : public vtkSlicerMarkupsWidgetRepresentation3D
56{
57public:
60
63 void PrintSelf(ostream& os, vtkIndent indent) override;
64
68 void UpdateFromMRMLInternal(vtkMRMLNode* caller, unsigned long event, void *callData=nullptr) override;
69
72
74 void GetActors(vtkPropCollection *) override;
75 void ReleaseGraphicsResources(vtkWindow *) override;
76 int RenderOverlay(vtkViewport *viewport) override;
77 int RenderOpaqueGeometry(vtkViewport *viewport) override;
78 int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
79 vtkTypeBool HasTranslucentPolygonalGeometry() override;
80
82 double* GetBounds() VTK_SIZEHINT(6) override;
83
84 void CanInteract(vtkMRMLInteractionEventData* interactionEventData,
85 int& foundComponentType, int& foundComponentIndex, double& closestDistance2) override;
86
87 void CanInteractWithROI(vtkMRMLInteractionEventData* interactionEventData,
88 int& foundComponentType, int& foundComponentIndex, double& closestDistance2);
89
90protected:
93
94 // Initialize interaction handle pipeline
95 void SetupInteractionPipeline() override;
96
97 // Update visibility of interaction handles for representation
98 void UpdateInteractionPipeline() override;
99
100 void SetROISource(vtkPolyDataAlgorithm* roiSource);
101
102 vtkSmartPointer<vtkPolyDataAlgorithm> ROISource;
103
104 vtkSmartPointer<vtkPassThrough> ROIPipelineInputFilter;
105
106 vtkSmartPointer<vtkTransformPolyDataFilter> ROITransformFilter;
107 vtkSmartPointer<vtkTransform> ROIToWorldTransform;
108
109 vtkSmartPointer<vtkPolyDataMapper> ROIMapper;
110 vtkSmartPointer<vtkProperty> ROIProperty;
111 vtkSmartPointer<vtkActor> ROIActor;
112
113 vtkSmartPointer<vtkPolyDataMapper> ROIOccludedMapper;
114 vtkSmartPointer<vtkProperty> ROIOccludedProperty;
115 vtkSmartPointer<vtkActor> ROIOccludedActor;
116
117 vtkSmartPointer<vtkOutlineFilter> ROIOutlineFilter;
118
119 vtkSmartPointer<vtkTransformPolyDataFilter> ROIOutlineTransformFilter;
120
121 vtkSmartPointer<vtkPolyDataMapper> ROIOutlineMapper;
122 vtkSmartPointer<vtkProperty> ROIOutlineProperty;
123 vtkSmartPointer<vtkActor> ROIOutlineActor;
124
125 vtkSmartPointer<vtkPolyDataMapper> ROIOutlineOccludedMapper;
126 vtkSmartPointer<vtkProperty> ROIOutlineOccludedProperty;
127 vtkSmartPointer<vtkActor> ROIOutlineOccludedActor;
128
129 class VTK_SLICER_MARKUPS_MODULE_VTKWIDGETS_EXPORT MarkupsInteractionPipelineROI : public MarkupsInteractionPipeline
130 {
131 public:
133 ~MarkupsInteractionPipelineROI() override = default;
134
135 // Initialize scale handles
136 void CreateScaleHandles() override;
137
138 // Update scale handle positions
139 virtual void UpdateScaleHandles();
140
141 // Update scale handle visibilities
142 void UpdateHandleVisibility() override;
143
144 // Get handle opacity
145 double GetHandleOpacity(int type, int index) override;
146
147
148 void GetHandleColor(int type, int index, double color[4]) override;
150 void GetInteractionHandleAxisWorld(int type, int index, double axis[3]) override;
151 };
153
154private:
156 void operator=(const vtkSlicerROIRepresentation3D&) = delete;
157};
158
159#endif
MRML node to represent an ROI markup.
Abstract Superclass for all specific types of MRML nodes.
Default representation for the markups widget in 3D views.
std::vector< MarkupsInteractionPipeline::HandleInfo > HandleInfoList
Default representation for the plane widget.
MarkupsInteractionPipelineROI(vtkSlicerMarkupsWidgetRepresentation *representation)
void GetInteractionHandleAxisWorld(int type, int index, double axis[3]) override
Get the direction vector of the interaction handle from the interaction origin in world coordinates.
void GetHandleColor(int type, int index, double color[4]) override
HandleInfoList GetHandleInfoList() override
Get the list of info for all interaction handles.
double GetHandleOpacity(int type, int index) override
Get the opacity of the specified handle.
Default representation for the plane widget.
void UpdateFromMRMLInternal(vtkMRMLNode *caller, unsigned long event, void *callData=nullptr) override
void ReleaseGraphicsResources(vtkWindow *) override
static vtkSlicerROIRepresentation3D * New()
Instantiate this class.
vtkTypeBool HasTranslucentPolygonalGeometry() override
double * GetBounds() VTK_SIZEHINT(6) override
Return the bounds of the representation.
int RenderOverlay(vtkViewport *viewport) override
void PrintSelf(ostream &os, vtkIndent indent) override
void GetActors(vtkPropCollection *) override
Methods to make this class behave as a vtkProp.
int RenderOpaqueGeometry(vtkViewport *viewport) override
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
virtual void UpdateCubeSourceFromMRML(vtkMRMLMarkupsROINode *roiNode)
Updates the dimensions of the cube source filter.