From 152ece572a10dda7c96b270f2a1c213e87ae944c Mon Sep 17 00:00:00 2001 From: Kimberly Meechan <24316371+K-Meech@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:00:06 +0100 Subject: [PATCH] Import header from brainglobe-utils (#399) * import header from brainglobe-utils * bump brainglobe-utils version and ensure new header is created every time --- cellfinder/napari/detect/detect.py | 8 ++---- cellfinder/napari/images/brainglobe.png | Bin 21216 -> 0 bytes cellfinder/napari/train/train.py | 11 ++------ cellfinder/napari/utils.py | 35 +++++++++--------------- pyproject.toml | 2 +- 5 files changed, 18 insertions(+), 38 deletions(-) delete mode 100644 cellfinder/napari/images/brainglobe.png diff --git a/cellfinder/napari/detect/detect.py b/cellfinder/napari/detect/detect.py index 396f90b6..f0efe488 100644 --- a/cellfinder/napari/detect/detect.py +++ b/cellfinder/napari/detect/detect.py @@ -11,9 +11,8 @@ from cellfinder.core.classify.cube_generator import get_cube_depth_min_max from cellfinder.napari.utils import ( add_layers, - header_label_widget, + cellfinder_header, html_label_widget, - widget_header, ) from .detect_containers import ( @@ -40,7 +39,6 @@ def detect_widget() -> FunctionGui: progress_bar = ProgressBar() @magicgui( - header=header_label_widget, detection_label=html_label_widget("Cell detection", tag="h3"), **DataInputs.widget_representation(), **DetectionInputs.widget_representation(), @@ -52,7 +50,6 @@ def detect_widget() -> FunctionGui: scrollable=True, ) def widget( - header, detection_label, data_options, viewer: napari.Viewer, @@ -205,8 +202,7 @@ def update_progress_bar(label: str, max: int, value: int): worker.update_progress_bar.connect(update_progress_bar) worker.start() - widget.header.value = widget_header - widget.header.native.setOpenExternalLinks(True) + widget.native.layout().insertWidget(0, cellfinder_header()) @widget.reset_button.changed.connect def restore_defaults(): diff --git a/cellfinder/napari/images/brainglobe.png b/cellfinder/napari/images/brainglobe.png deleted file mode 100644 index 427bdaba9b89f967c183f4a998e7e642df50600d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21216 zcmbqb1zS~Hv;{#z8YH9<6qJ_ku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}(4b1O(~DtcKC9VyBGlC)m294HNful|L^&MIiZYf?{a%%!3e})@7BrScn+TNcHiEw` z`7u4!D+-s!`w~@T#U~X+h2)s>nFN=jq%0@CwPt?kJFajjEjwJt=wQkw-+Dx&8C6v>;>#g9a46@ zBMo-Bp|zDi38d$)gip}9{Bz3B63vPO7dz-{r9YA2OB}71m?SAAr1$ z%8KXO)8jmOFu%a{)Jw9fxB=m=f`gzW((Hl%dcYth$*0^JsyU3sVp#-j4<;(YcdC5j z>F#sqos_}U1Cs!z089j!#*Qt3Ndva=Ul+i)|6rWQn6_hRC_w diff --git a/cellfinder/napari/train/train.py b/cellfinder/napari/train/train.py index 4d5e005b..d604bf4b 100644 --- a/cellfinder/napari/train/train.py +++ b/cellfinder/napari/train/train.py @@ -8,11 +8,7 @@ from qtpy.QtWidgets import QScrollArea from cellfinder.core.train.train_yml import run as train_yml -from cellfinder.napari.utils import ( - header_label_widget, - html_label_widget, - widget_header, -) +from cellfinder.napari.utils import cellfinder_header, html_label_widget from .train_containers import ( MiscTrainingInputs, @@ -41,7 +37,6 @@ def run_training( def training_widget() -> FunctionGui: @magicgui( - header=header_label_widget, training_label=html_label_widget("Network training", tag="h3"), **TrainingDataInputs.widget_representation(), **OptionalNetworkInputs.widget_representation(), @@ -52,7 +47,6 @@ def training_widget() -> FunctionGui: scrollable=True, ) def widget( - header: dict, training_label: dict, data_options: dict, yaml_files: Path, @@ -161,8 +155,7 @@ def widget( ) worker.start() - widget.header.value = widget_header - widget.header.native.setOpenExternalLinks(True) + widget.native.layout().insertWidget(0, cellfinder_header()) @widget.reset_button.changed.connect def restore_defaults(): diff --git a/cellfinder/napari/utils.py b/cellfinder/napari/utils.py index 689b2842..d48b81fb 100644 --- a/cellfinder/napari/utils.py +++ b/cellfinder/napari/utils.py @@ -4,21 +4,7 @@ import numpy as np import pandas as pd from brainglobe_utils.cells.cells import Cell -from pkg_resources import resource_filename - -brainglobe_logo = resource_filename( - "cellfinder", "napari/images/brainglobe.png" -) - - -widget_header = """ -

Efficient cell detection in large images.

-

Website

-

Documentation

-

Source

-

Citation

-

For help, hover the cursor over each parameter. -""" # noqa: E501 +from brainglobe_utils.qtpy.logo import header_widget def html_label_widget(label: str, *, tag: str = "b") -> dict: @@ -31,13 +17,18 @@ def html_label_widget(label: str, *, tag: str = "b") -> dict: ) -header_label_widget = html_label_widget( - f""" - -

cellfinder

-""", - tag="h1", -) +def cellfinder_header(): + """ + Create the header containing the brainglobe logo and documentation links + for all cellfinder widgets. + """ + return header_widget( + "cellfinder", + "Efficient cell detection in large images.", + documentation_path="cellfinder/user-guide/napari-plugin/index.html", + citation_doi="https://doi.org/10.1371/journal.pcbi.1009074", + help_text="For help, hover the cursor over each parameter.", + ) def add_layers(points: List[Cell], viewer: napari.Viewer) -> None: diff --git a/pyproject.toml b/pyproject.toml index efdb36f0..6e5ac59d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ classifiers = [ ] requires-python = ">=3.9" dependencies = [ - "brainglobe-utils>=0.4.2", + "brainglobe-utils>=0.4.3", "brainglobe-napari-io>=0.3.4", "dask[array]", "fancylog>=0.0.7",