Skip to content

Commit

Permalink
Add header from brainglobe-utils (#172)
Browse files Browse the repository at this point in the history
* add header from brainglobe-utils

* update brainglobe-utils dependency

---------

Co-authored-by: Adam Tyson <[email protected]>
  • Loading branch information
K-Meech and adamltyson authored Apr 22, 2024
1 parent 301dcb5 commit d46749a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
22 changes: 20 additions & 2 deletions brainglobe_segmentation/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import numpy as np
from brainglobe_utils.qtpy.dialog import display_warning
from brainglobe_utils.qtpy.interaction import add_button
from brainglobe_utils.qtpy.logo import header_widget
from napari.qt.threading import thread_worker
from qtpy import QtCore
from qtpy.QtWidgets import QFileDialog, QGridLayout, QGroupBox, QLabel, QWidget
Expand Down Expand Up @@ -112,12 +113,13 @@ def setup_main_layout(self):
self.layout.setAlignment(QtCore.Qt.AlignTop)
self.layout.setSpacing(4)

# 3 Steps:
# 4 Steps:
# - header
# - Loading panel
# - Segmentation methods panel
# -> Individual segmentation methods (which are invisible at first)
# - Saving panel

self.add_header()
self.add_loading_panel(1)
self.add_segmentation_methods_panel(1)
self.track_seg.add_track_panel(2) # Track segmentation subpanel
Expand All @@ -133,6 +135,22 @@ def setup_main_layout(self):

# PANELS ###############################################################

def add_header(self):
"""
Header including brainglobe logo and documentation links.
"""
# <br> is included in the package_name to make the label under the logo
# more compact, by splitting it onto two lines
header = header_widget(
package_name="brainglobe-<br>segmentation",
package_tagline="Segmentation of anatomical structures",
documentation_path="brainglobe-segmentation/user-guide/index.html",
github_repo_name="brainglobe-segmentation",
citation_doi="https://doi.org/10.1038/s41598-021-04676-9",
help_text="For help, hover the cursor over each parameter.",
)
self.layout.addWidget(header, 0, 0, 1, 2)

def add_segmentation_methods_panel(self, row, column=1):
"""
Segmentation methods chooser panel:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ requires-python = ">=3.9"
dependencies = [
"brainglobe-atlasapi >=2.0.1",
"brainglobe-napari-io >=0.3.0",
"brainglobe-utils >=0.4.0",
"brainglobe-utils >=0.4.3",
"napari >=0.4.5",
"numpy",
"pandas[hdf5]",
Expand Down

0 comments on commit d46749a

Please sign in to comment.