Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add header from brainglobe-utils #172

Merged
merged 3 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading