From 307b16a97e223b496182f3e516f405cb0fc7d75c Mon Sep 17 00:00:00 2001 From: Kimberly Meechan <24316371+K-Meech@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:27:09 +0100 Subject: [PATCH 1/2] import header from brainglobe-utils --- brainreg/napari/register.py | 18 ++++++++++++++++++ pyproject.toml | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/brainreg/napari/register.py b/brainreg/napari/register.py index c780bdc..7e97ed3 100644 --- a/brainreg/napari/register.py +++ b/brainreg/napari/register.py @@ -13,11 +13,13 @@ from brainglobe_napari_io.brainmapper.brainmapper_reader_dir import ( load_registration, ) +from brainglobe_utils.qtpy.logo import header_widget from fancylog import fancylog from magicgui import magicgui from napari._qt.qthreading import thread_worker from napari.types import LayerDataTuple from napari.utils.notifications import show_info +from PyQt5.QtWidgets import QScrollArea import brainreg as program_for_log from brainreg.core.backend.niftyreg.run import run_niftyreg @@ -218,6 +220,7 @@ def brainreg_register(): check_orientation_button=dict( widget_type="PushButton", text="Check orientation" ), + scrollable=True, ) def widget( viewer: napari.Viewer, @@ -594,4 +597,19 @@ def check_orientation(event=None): scale=[s1, s2], ) + widget.native.layout().insertWidget( + 0, + header_widget( + "brainreg", + "Automated 3D brain registration", + tutorial_file_name="tutorial-whole-brain-registration.html", + citation_doi="https://doi.org/10.1038/s41598-021-04676-9", + help_text="For help, hover the cursor over each parameter.", + ), + ) + + scroll = QScrollArea() + scroll.setWidget(widget._widget._qwidget) + widget._widget._qwidget = scroll + return widget diff --git a/pyproject.toml b/pyproject.toml index 1cc8d0b..a82ca4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ requires-python = ">=3.9" dependencies = [ "brainglobe-atlasapi>=2.0.1", "brainglobe-space>=1.0.0", - "brainglobe-utils>=0.4.2", + "brainglobe-utils>=0.4.3", "fancylog", "numpy", "scikit-image", From 76b3eb5aac06e21d178783a0aeaae5435be3b953 Mon Sep 17 00:00:00 2001 From: Kimberly Meechan <24316371+K-Meech@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:43:26 +0100 Subject: [PATCH 2/2] fix scroll area import --- brainreg/napari/register.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brainreg/napari/register.py b/brainreg/napari/register.py index 7e97ed3..448a440 100644 --- a/brainreg/napari/register.py +++ b/brainreg/napari/register.py @@ -19,7 +19,7 @@ from napari._qt.qthreading import thread_worker from napari.types import LayerDataTuple from napari.utils.notifications import show_info -from PyQt5.QtWidgets import QScrollArea +from qtpy.QtWidgets import QScrollArea import brainreg as program_for_log from brainreg.core.backend.niftyreg.run import run_niftyreg