コード例 #1
0
 def onFiducialListSelected(self, node):
     if node:
         self.fiducialsWidget.currentNode = node
         self.fiducialsWidget.currentNode.AddObserver(
             slicer.vtkMRMLMarkupsNode().PointPositionDefinedEvent,
             self.onEndTargetPlacement)
         self.fiducialsWidget.currentNode.AddObserver(
             slicer.vtkMRMLMarkupsNode().PointPositionUndefinedEvent,
             self.onEndTargetRemove)
コード例 #2
0
 def setupFiducialWidgetAndTableWidget(self):
     self.targetingPlugin.fiducialsWidget.addEventObserver(
         slicer.vtkMRMLMarkupsNode().PointPositionDefinedEvent,
         self.updateAffectiveZoneAndDistance)
     self.targetingPlugin.fiducialsWidget.addEventObserver(
         slicer.vtkMRMLMarkupsNode().PointPositionUndefinedEvent,
         self.updateAffectiveZoneAndDistance)
     self.targetingPlugin.targetTablePlugin.addEventObserver(
         self.targetingPlugin.targetTablePlugin.TargetPosUpdatedEvent,
         self.updateAffectiveZoneAndDistance)
コード例 #3
0
 def onEndTargetPlacement(self, interactionNode=None, event=None):
     if self.fiducialsWidget.currentNode:
         currentTargetIndex = self.fiducialsWidget.currentNode.GetNumberOfFiducials(
         ) - 1
         guidance = self.targetTablePlugin.targetTableModel.getOrCreateNewGuidanceComputation(
             self.fiducialsWidget.currentNode)
         needleSnapPosition = guidance.getNeedleEndPos(currentTargetIndex)
         self.fiducialsWidget.currentNode.SetNthFiducialPositionFromArray(
             currentTargetIndex, needleSnapPosition)
         self.session.displayForTargets[
             self.fiducialsWidget.currentNode.GetNthMarkupID(
                 currentTargetIndex)] = qt.Qt.Unchecked
         self.session.needleTypeForTargets[
             self.fiducialsWidget.currentNode.GetNthMarkupID(
                 currentTargetIndex)] = self.session.ISSEEDTYPE
         self.fiducialsWidget.invokeEvent(
             slicer.vtkMRMLMarkupsNode().PointPositionDefinedEvent)
     pass
コード例 #4
0
    def onEndTargetRemove(self, caller, event, callData):
        tempCheckBoxList = self.targetTablePlugin.checkBoxList.copy()
        tempComboBoxList = self.targetTablePlugin.comboBoxList.copy()
        tempDisplayForTargets = self.session.displayForTargets.copy()
        tempNeedleTypeForTargets = self.session.needleTypeForTargets.copy()

        self.targetTablePlugin.checkBoxList.clear()
        self.targetTablePlugin.comboBoxList.clear()
        self.session.displayForTargets.clear()
        self.session.needleTypeForTargets.clear()
        for index in range(
                self.fiducialsWidget.currentNode.GetNumberOfFiducials()):
            key = self.fiducialsWidget.currentNode.GetNthMarkupID(index)
            if key is not None:
                self.targetTablePlugin.checkBoxList[
                    key] = tempCheckBoxList.get(key)
                self.targetTablePlugin.comboBoxList[
                    key] = tempComboBoxList.get(key)
                self.session.displayForTargets[
                    key] = tempDisplayForTargets.get(key)
                self.session.needleTypeForTargets[
                    key] = tempNeedleTypeForTargets.get(key)
        self.fiducialsWidget.invokeEvent(
            slicer.vtkMRMLMarkupsNode().PointRemovedEvent)