Skip to content

Commit

Permalink
🗿 Cleaning some more GUI stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
brennanaba committed Sep 29, 2020
1 parent cd95e2e commit e76db97
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions Paint4Brains/GUI/MainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ def __init__(self, file, label_file=None):
# Predefined actions that usually appear when you right click. Recycling one that resets the view here.
viewBoxActionsList = self.main_widget.win.view.menu.actions()

resetViewAction = viewBoxActionsList[0]
resetViewAction.setText("Recenter View")
resetViewAction.setShortcut('Ctrl+V')
self.view_menu.addAction(resetViewAction)

oldButtonsAction = QAction('Single View Mode', self)
oldButtonsAction.setStatusTip('Sets layout to single window mode')
oldButtonsAction.triggered.connect(
Expand All @@ -106,15 +101,20 @@ def __init__(self, file, label_file=None):
viewVisualizationAction.triggered.connect(
self.view_visualization_tools)
self.view_menu.addAction(viewVisualizationAction)

self.view_menu.addSeparator()

resetViewAction = viewBoxActionsList[0]
resetViewAction.setText("Recenter View")
resetViewAction.setShortcut('Ctrl+V')
self.view_menu.addAction(resetViewAction)

seeAllAction = QAction('All Labels', self)
seeAllAction.setShortcut('Ctrl+A')
seeAllAction.setStatusTip('Edit Next Segmented label')
seeAllAction.triggered.connect(self.main_widget.win.view_back_labels)
self.view_menu.addAction(seeAllAction)


nextLabelAction = QAction('Next Label', self)
nextLabelAction.setShortcut('Ctrl+N')
nextLabelAction.setStatusTip('Edit Next Segmented label')
Expand All @@ -133,11 +133,12 @@ def __init__(self, file, label_file=None):
self.edit.addAction(selectLabelAction)
self.edit.addSeparator()

nodrawAction = QAction('Deactivate drawing', self)
nodrawAction = QAction('Drawing Mode', self)
nodrawAction.setShortcut('Ctrl+D')
nodrawAction.setStatusTip('Deactivate drawing')
nodrawAction.setStatusTip('Activate/Deactivate drawing mode')
nodrawAction.triggered.connect(self.main_widget.win.disable_drawing)
self.edit.addAction(nodrawAction)
self.edit.addSeparator()

undoAction = QAction('Undo', self)
undoAction.setShortcut('Ctrl+Z')
Expand All @@ -151,7 +152,7 @@ def __init__(self, file, label_file=None):
undoAction.triggered.connect(self.main_widget.win.redo_previous_edit)
self.edit.addAction(undoAction)

histogramAction = QAction('Adjust Full Brain Intensity', self)
histogramAction = QAction('Adjust Brain Intensity', self)
histogramAction.setShortcut('Ctrl+H')
histogramAction.setStatusTip('View Intensity Histogram')
histogramAction.triggered.connect(self.view_histogram)
Expand Down Expand Up @@ -326,6 +327,11 @@ def view_visualization_tools(self):
self.optional_sliders.setVisible(switch)

def view_histogram(self):
"""Toggle histogram widget
Opens an intensity histogram for all voxels in the nii file.
This enables the user to make intensity corrections on the loaded brain.
"""
switch = not self.hist_widget.isVisible()
self.hist_widget.setVisible(switch)

Expand Down

0 comments on commit e76db97

Please sign in to comment.