Skip to content

Commit

Permalink
STYLE: Hiding unneeded editor components and reorganized buttons for …
Browse files Browse the repository at this point in the history
…a better style (issue QIICR#74)
  • Loading branch information
che85 committed Sep 19, 2016
1 parent c3a06fb commit 13b35b1
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions Py/Reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from SegmentEditor import SegmentEditorWidget
from LabelStatistics import LabelStatisticsWidget


class Reporting(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, available at:
https://github.com/Slicer/Slicer/blob/master/Base/Python/slicer/ScriptedLoadableModule.py
Expand Down Expand Up @@ -72,7 +73,7 @@ def setup(self):

def setupWatchbox(self):
self.watchBoxInformation = [
WatchBoxAttribute('StudyID', 'Study ID: ', DICOMTAGS.PATIENT_BIRTH_DATE),
WatchBoxAttribute('StudyID', 'Study ID: ', DICOMTAGS.STUDY_ID),
WatchBoxAttribute('PatientName', 'Patient Name: ', DICOMTAGS.PATIENT_NAME),
WatchBoxAttribute('DOB', 'Date of Birth: ', DICOMTAGS.PATIENT_BIRTH_DATE),
WatchBoxAttribute('Reader', 'Reader Name: ', callback=getpass.getuser)]
Expand All @@ -99,8 +100,8 @@ def setupSegmentationsArea(self):
self.editorWidget = SegmentEditorWidget(parent=self.segmentationWidget)
self.editorWidget.setup()
self.segmentationWidget.children()[1].hide()
self.editorWidget.editor.segmentationNodeSelectorVisible = False
self.editorWidget.editor.masterVolumeNodeSelectorVisible = False
self.hideUnwantedEditorUIElements()
self.reorganizeEffectButtons()
self.clearSegmentationEditorSelectors()
self.layout.addWidget(self.segmentationWidget)

Expand All @@ -109,8 +110,17 @@ def clearSegmentationEditorSelectors(self):
self.editorWidget.editor.setMasterVolumeNode(None)

def hideUnwantedEditorUIElements(self):
for widgetName in ['MRMLNodeComboBox_MasterVolume']:
widget = slicer.util.findChildren(self.editorWidget.volumes, widgetName)[0]
self.editorWidget.editor.segmentationNodeSelectorVisible = False
self.editorWidget.editor.masterVolumeNodeSelectorVisible = False
for widgetName in ["OptionsGroupBox","MaskingGroupBox"]:
widget = slicer.util.findChildren(self.editorWidget.editor, widgetName)[0]
widget.hide()

def reorganizeEffectButtons(self):
widget = slicer.util.findChildren(self.editorWidget.editor, "EffectsGroupBox")[0]
if widget:
buttons = [b for b in widget.children() if isinstance(b, qt.QPushButton)]
self.segmentationWidgetLayout.addWidget(self.createHLayout(buttons))
widget.hide()

def setupMeasurementsArea(self):
Expand Down

0 comments on commit 13b35b1

Please sign in to comment.