Slicer 5.6
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkSlicerROIRepresentation2D.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 vtkSlicerROIRepresentation2D_h
33#define vtkSlicerROIRepresentation2D_h
34
35#include "vtkSlicerMarkupsModuleVTKWidgetsExport.h"
38
39class vtkAppendPolyData;
40class vtkClipPolyData;
41class vtkContourTriangulator;
42class vtkCutter;
43class vtkDiscretizableColorTransferFunction;
45class vtkOutlineFilter;
46class vtkSampleImplicitFunctionFilter;
47
48class VTK_SLICER_MARKUPS_MODULE_VTKWIDGETS_EXPORT vtkSlicerROIRepresentation2D : public vtkSlicerMarkupsWidgetRepresentation2D
49{
50public:
53
56 void PrintSelf(ostream& os, vtkIndent indent) override;
57
61 void UpdateFromMRMLInternal(vtkMRMLNode* caller, unsigned long event, void *callData = nullptr) override;
62
64 void GetActors(vtkPropCollection *) override;
65 void ReleaseGraphicsResources(vtkWindow *) override;
66 int RenderOverlay(vtkViewport *viewport) override;
67 int RenderOpaqueGeometry(vtkViewport *viewport) override;
68 int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
69 vtkTypeBool HasTranslucentPolygonalGeometry() override;
70
72 double* GetBounds() VTK_SIZEHINT(6) override;
73
74 void CanInteract(vtkMRMLInteractionEventData* interactionEventData,
75 int& foundComponentType, int& foundComponentIndex, double& closestDistance2) override;
76
77 void CanInteractWithROI(vtkMRMLInteractionEventData* interactionEventData,
78 int& foundComponentType, int& foundComponentIndex, double& closestDistance2);
79
80 // Update visibility of interaction handles for representation
81 void UpdateInteractionPipeline() override;
82
83protected:
84
86 virtual void UpdateCubeSourceFromMRML(vtkMRMLMarkupsROINode* roiNode);
87
88 // Initialize interaction handle pipeline
89 void SetupInteractionPipeline() override;
90
91protected:
94
95 void SetROISource(vtkPolyDataAlgorithm* roiSource);
96
97 vtkSmartPointer<vtkPolyDataAlgorithm> ROISource;
98
99 vtkSmartPointer<vtkPassThrough> ROIPipelineInputFilter;
100 vtkSmartPointer<vtkTransform> ROIToWorldTransform;
101 vtkSmartPointer<vtkTransformPolyDataFilter> ROIToWorldTransformFilter;
102 vtkSmartPointer<vtkCutter> ROIOutlineCutter;
103 vtkSmartPointer<vtkTransformPolyDataFilter> ROIOutlineWorldToSliceTransformFilter;
104 vtkSmartPointer<vtkContourTriangulator> ROIIntersectionTriangulator;
105
106 vtkSmartPointer<vtkPolyDataMapper2D> ROIMapper;
107 vtkSmartPointer<vtkProperty2D> ROIProperty;
108 vtkSmartPointer<vtkActor2D> ROIActor;
109
110 vtkSmartPointer<vtkPolyDataMapper2D> ROIOutlineMapper;
111 vtkSmartPointer<vtkProperty2D> ROIOutlineProperty;
112 vtkSmartPointer<vtkActor2D> ROIOutlineActor;
113
114 class MarkupsInteractionPipelineROI2D : public vtkSlicerROIRepresentation3D::MarkupsInteractionPipelineROI
115 {
116 public:
119 void GetViewPlaneNormal(double viewPlaneNormal[3]) override;
120 void UpdateScaleHandles() override;
121 void AddScaleEdgeIntersection(int pointIndex, vtkIdTypeArray* visibilityArray, vtkPoints* scaleHandleArray,
122 double sliceNormal[3], double sliceOrigin[3], double edgePoint[3], double edgeVector[3]);
123 vtkSmartPointer<vtkTransformPolyDataFilter> WorldToSliceTransformFilter;
124 };
125
126private:
128 void operator=(const vtkSlicerROIRepresentation2D&) = delete;
129};
130
131#endif
MRML node to represent an ROI markup.
Abstract Superclass for all specific types of MRML nodes.
Default representation for the slicer markups widget.
void AddScaleEdgeIntersection(int pointIndex, vtkIdTypeArray *visibilityArray, vtkPoints *scaleHandleArray, double sliceNormal[3], double sliceOrigin[3], double edgePoint[3], double edgeVector[3])
MarkupsInteractionPipelineROI2D(vtkSlicerMarkupsWidgetRepresentation *representation)
vtkSmartPointer< vtkTransformPolyDataFilter > WorldToSliceTransformFilter
void GetViewPlaneNormal(double viewPlaneNormal[3]) override
Get the view plane normal for the widget in world coordinates.
Default representation for the plane widget.
void UpdateFromMRMLInternal(vtkMRMLNode *caller, unsigned long event, void *callData=nullptr) override
double * GetBounds() VTK_SIZEHINT(6) override
Return the bounds of the representation.
int RenderOverlay(vtkViewport *viewport) override
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
int RenderOpaqueGeometry(vtkViewport *viewport) override
void GetActors(vtkPropCollection *) override
Methods to make this class behave as a vtkProp.
void ReleaseGraphicsResources(vtkWindow *) override
static vtkSlicerROIRepresentation2D * New()
Instantiate this class.
void PrintSelf(ostream &os, vtkIndent indent) override
vtkTypeBool HasTranslucentPolygonalGeometry() override
Default representation for the plane widget.