Sam_Horvath
(Sam Horvath (Kitware))
March 4, 2020, 4:55pm
2
slicer.util has this function:
def setApplicationLogoVisible(visible):
"""Show/hide application logo at the top of module panel."""
widget = findChild(mainWindow(), "LogoLabel")
widget.setVisible(visible)
def setModuleHelpSectionVisible(visible):
"""Show/hide Help section at the top of module panel."""
modulePanel = findChild(mainWindow(), "ModulePanel")
modulePanel.helpAndAcknowledgmentVisible = visible
def setDataProbeVisible(visible):
"""Show/hide Data probe at the bottom of module panel."""
widget = findChild(mainWindow(), "DataProbeCollapsibleWidget")
widget.setVisible(visible)
which you can use with detecting when your module is entered/exited to hide the data probe. This can be done by defining the enter() / exit() functions in your module. See:
if compositeNode.GetBackgroundVolumeID():
return compositeNode.GetBackgroundVolumeID()
# Use first background volume node in any of the displayed layouts
for layoutName in layoutManager.sliceViewNames():
compositeNode = self.getCompositeNode(layoutName)
if compositeNode.GetForegroundVolumeID():
return compositeNode.GetForegroundVolumeID()
# Not found anything
return None
def enter(self):
"""Runs whenever the module is reopened
"""
if self.editor.turnOffLightboxes():
slicer.util.warningDisplay('Segment Editor is not compatible with slice viewers in light box mode.'
'Views are being reset.', windowTitle='Segment Editor')
# Allow switching between effects and selected segment using keyboard shortcuts
self.editor.installKeyboardShortcuts()
# Set parameter set node if absent
2 Likes