def markupsNodes(self): return { slicer.vtkMRMLMarkupsAngleNode(): slicer.vtkSlicerAngleWidget(), slicer.vtkMRMLMarkupsClosedCurveNode(): slicer.vtkSlicerCurveWidget(), slicer.vtkMRMLMarkupsCurveNode(): slicer.vtkSlicerCurveWidget(), slicer.vtkMRMLMarkupsFiducialNode(): slicer.vtkSlicerPointsWidget(), slicer.vtkMRMLMarkupsLineNode(): slicer.vtkSlicerLineWidget(), slicer.vtkMRMLMarkupsPlaneNode(): slicer.vtkSlicerPlaneWidget(), slicer.vtkMRMLMarkupsROINode(): slicer.vtkSlicerROIWidget(), slicer.vtkMRMLMarkupsTestLineNode(): slicer.vtkSlicerTestLineWidget() }
def onSelectViewAction(self, selectOption): interactionNode = slicer.app.applicationLogic().GetInteractionNode() selectionNode = slicer.app.applicationLogic().GetSelectionNode() self.closedCurveNode = slicer.vtkMRMLMarkupsClosedCurveNode() slicer.mrmlScene.AddNode(self.closedCurveNode) self.closedCurveNode.SetCurveTypeToLinear() self.closedCurveNode.CreateDefaultDisplayNodes() self.closedCurveNode.SetName("Enclose points to delete") interactionNode.SetCurrentInteractionMode(interactionNode.Place) eventID = interactionNode.EndPlacementEvent self.observerTag = interactionNode.AddObserver( eventID, self.onCurveInteractionEnded) self.currentSelectOption = selectOption