Commit 2f16ccde authored by jcfr's avatar jcfr
Browse files

ENH: Set slicer.mrmlScene in slicerqy.py instead of slicerqt-with-tcl.py

git-svn-id: http://svn.slicer.org/Slicer4/trunk@15414 3bd1e089-480b-0410-8dfb-8563597acbee
parent 6b92ac4b
......@@ -64,12 +64,7 @@ def registerScriptedDisplayableManagers(sliceWidget):
# set the new tcl instance into the sliceGUI instance for this slice
tcl('%s %s $procName' % (sliceGUIName, method))
#
# if the mrmlScene is not yet set in python, set it here
# TODO: maybe should be done in python manager
try:
slicer.mrmlScene
except AttributeError:
slicer.mrmlScene = eval("slicer.sliceWidget%s_sliceLogic.GetMRMLScene()" % sliceWidget)
sWidget = tcl('SliceSWidget #auto %s' % sliceGUIName)
tcl('%s configure -calculateAnnotations 0' % sWidget)
tcl('''
......
......@@ -70,6 +70,9 @@ class _Internal():
_modules = imp.new_module('modules')
setattr(slicer, _modules.__name__, _modules)
# Retrieve current instance of the scene and set 'slicer.mrmlScene'
setattr(slicer, 'mrmlScene', app().mrmlScene())
def setSlicerModuleNames(self):
"""Add module names as attributes of module slicer.moduleNames"""
......
......@@ -70,9 +70,8 @@ public:
/// Note: initialize() should be called only one time.
bool initialized() const;
///
/// Get MRML Scene
vtkMRMLScene* mrmlScene() const;
Q_INVOKABLE vtkMRMLScene* mrmlScene() const;
///
/// Set MRML Scene
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment