View Issue Details

IDProjectCategoryView StatusLast Update
0004355Slicer4Core: Base Codepublic2017-06-10 18:41
Reporterleochan2009 Assigned Tojcfr  
PriorityhighSeveritymajorReproducibilitysometimes
Status closedResolutionduplicate 
PlatformMacOSsierraOS Version
Product Version 
Target VersionFixed in VersionSlicer 4.7.0 
Summary0004355: interactionNode sometimes can not activate MarkupsPlaceWidget
Description

I get the interactionNode get from slicer.mrmlScene.GetNodeByID("vtkMRMLInteractionNodeSingleton")
And call interactioNode.SwitchToSinglePlaceMode ()
this call not always activates the MarkupsPlaceWidget in the slicer app GUI
My 3DSlicer version is 4.7.0-2017-02-14

TagsNo tags attached.

Relationships

duplicate of 0004377 resolvedlassoan Setting mode on vtkMRMLInteractionNodeSingleton programmatically does not work when doing fresh start of Slicer 

Activities

criskross

criskross

2017-03-31 11:22

developer   ~0014400

Same happens for me but with setting a ROI.

The very first time executing the following code works:

annotationLogic = slicer.modules.annotations.logic()
selectionNode = slicer.mrmlScene.GetNthNodeByClass(0, "vtkMRMLSelectionNode")
selectionNode.SetReferenceActivePlaceNodeClassName("vtkMRMLAnnotationROINode")
annotationLogic.StartPlaceMode(False)

After deactivating programmatically place mode with

annotationLogic.StopPlaceMode()

and then

annotationLogic.StartPlaceMode(False)

the mode is not active

criskross

criskross

2017-04-12 12:30

developer   ~0014427

After freshly starting, please run the following code. It's supposed to start the place mode and listen to the event of the interactionModeChange.

def onInteractionModeChanged(caller, event):
interactionMode = interactionNode.GetCurrentInteractionMode()
if interactionMode == interactionNode.Place:
print "started"
elif interactionMode == interactionNode.ViewTransform:
print "end"

annotationsLogic = slicer.modules.annotations.logic()
appLogic = annotationsLogic.GetMRMLApplicationLogic()
interactionNode = appLogic.GetInteractionNode()
selectionNode = appLogic.GetSelectionNode()

tag = interactionNode.AddObserver(interactionNode.InteractionModeChangedEvent, onInteractionModeChanged)

Turn on

interactionNode.SetCurrentInteractionMode(interactionNode.Place)

The output of that will be:
started
end

criskross

criskross

2017-04-12 15:53

developer   ~0014429

The following code works as a workaround:

def onInteractionModeChanged(caller, event):
interactionMode = interactionNode.GetCurrentInteractionMode()
if interactionMode == interactionNode.Place:
print "started"
elif interactionMode == interactionNode.ViewTransform:
print "end"

annotationsLogic = slicer.modules.annotations.logic()
markupsLogic = slicer.modules.markups.logic() # needed for setting active list
appLogic = annotationsLogic.GetMRMLApplicationLogic()
interactionNode = appLogic.GetInteractionNode()
selectionNode = appLogic.GetSelectionNode()

tag = interactionNode.AddObserver(interactionNode.InteractionModeChangedEvent, onInteractionModeChanged)

when no list is active in markupsLogic, it won't work

markupsLogic.AddNewFiducialNode()

Turn on

interactionNode.SetCurrentInteractionMode(interactionNode.Place)

Issue History

Date Modified Username Field Change
2017-03-22 15:14 leochan2009 New Issue
2017-03-22 15:14 leochan2009 Status new => assigned
2017-03-22 15:14 leochan2009 Assigned To => jcfr
2017-03-31 11:22 criskross Note Added: 0014400
2017-04-12 12:30 criskross Note Added: 0014427
2017-04-12 15:53 criskross Note Added: 0014429
2017-06-10 17:32 lassoan Status assigned => closed
2017-06-10 17:32 lassoan Resolution open => duplicate
2017-06-10 17:32 lassoan Relationship added duplicate of 0004377
2017-06-10 18:41 jcfr Fixed in Version => Slicer 4.7.0