diff --git a/MANIFEST.in b/MANIFEST.in index 0408c5f..32780ea 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,7 @@ include LICENSE include README.md include napari_bioimageio/VERSION +include napari_bioimageio/bioimage-io-logo-white.png exclude requirements*.txt exclude .* exclude pylintrc diff --git a/README.md b/README.md index 0428fd1..def917d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ -# napari-bioimage-io +# napari-bioimageio -napari plugin for managing AI models in the BioImage Model Zoo. +napari plugin for managing AI models in the [BioImage Model Zoo](https://bioimage.io). + +> **WARNING**: This is an alpha release. The API may change in future versions, and please feel free to create issues to report bugs or provide feedbacks. + +![](assets/screenshot-model-manager-1.png) ## Installation @@ -15,7 +19,6 @@ pip install napari-bioimageio This library is meant for helping developers to ease the handling of models in napari. We provide a set of API functions for managing and selecting models. - ### `show_model_manager()` Show the model manager with a model list pulled from the BioImage Model Zoo, the user can explore all the available models, download or remove models. @@ -43,6 +46,7 @@ if model_info: pipeline, input_image, padding=padding ) ``` +Note: To run the models, you need to setup the conda environment properly according to the [installation guide of bioimageio.core](https://github.com/bioimage-io/core-bioimage-io-python#installation). For more examples, see [this example notebook](https://github.com/bioimage-io/core-bioimage-io-python/blob/main/example/bioimageio-core-usage.ipynb) for `bioimageio.core`. diff --git a/assets/screenshot-model-manager-1.png b/assets/screenshot-model-manager-1.png new file mode 100644 index 0000000..7dacdfa Binary files /dev/null and b/assets/screenshot-model-manager-1.png differ diff --git a/examples/bioimageio-hpa/bioimageio_hpa/__init__.py b/examples/bioimageio-hpa/bioimageio_hpa/__init__.py deleted file mode 100644 index cf8cd23..0000000 --- a/examples/bioimageio-hpa/bioimageio_hpa/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from ._bhpa import QtBioImageIOHPA - -__all__ = [ - "QtBioImageIOHPA", -] diff --git a/examples/bioimageio-hpa/bioimageio_hpa/napari.yaml b/examples/bioimageio-hpa/bioimageio_hpa/napari.yaml deleted file mode 100644 index 6056611..0000000 --- a/examples/bioimageio-hpa/bioimageio_hpa/napari.yaml +++ /dev/null @@ -1,12 +0,0 @@ -name: bioimageio-hpa -display_name: BioImageIO HPA - -contributions: - commands: - - id: bioimageio-hpa.QtBioImageIOHPA - python_name: bioimageio_hpa._bhpa:QtBioImageIOHPA - title: BioImageIO HPA - - widgets: - - command: bioimageio-hpa.QtBioImageIOHPA - display_name: BioImageIO HPA diff --git a/examples/bioimageio-hpa/README.md b/examples/hpa-single-cell/README.md similarity index 87% rename from examples/bioimageio-hpa/README.md rename to examples/hpa-single-cell/README.md index e87f54a..0dda326 100644 --- a/examples/bioimageio-hpa/README.md +++ b/examples/hpa-single-cell/README.md @@ -6,6 +6,6 @@ This plugin demonstrate how to use the bioimageio model manager to fetch and run ## Installation ``` -cd examples/bioimageio-hpa +cd examples/hpa-single-cell pip install . ``` \ No newline at end of file diff --git a/examples/hpa-single-cell/hpa_single_cell/__init__.py b/examples/hpa-single-cell/hpa_single_cell/__init__.py new file mode 100644 index 0000000..94bf863 --- /dev/null +++ b/examples/hpa-single-cell/hpa_single_cell/__init__.py @@ -0,0 +1,5 @@ +from ._bhpa import QTHPASingleCell + +__all__ = [ + "QTHPASingleCell", +] diff --git a/examples/bioimageio-hpa/bioimageio_hpa/_bhpa.py b/examples/hpa-single-cell/hpa_single_cell/_bhpa.py similarity index 99% rename from examples/bioimageio-hpa/bioimageio_hpa/_bhpa.py rename to examples/hpa-single-cell/hpa_single_cell/_bhpa.py index cb12205..7feba13 100644 --- a/examples/bioimageio-hpa/bioimageio_hpa/_bhpa.py +++ b/examples/hpa-single-cell/hpa_single_cell/_bhpa.py @@ -83,7 +83,7 @@ custom_style = get_stylesheet("dark") -class QtBioImageIOHPA(QDialog): +class QTHPASingleCell(QDialog): def __init__(self, viewer: "napari.viewer.Viewer"): super().__init__() self._viewer = viewer diff --git a/examples/hpa-single-cell/hpa_single_cell/napari.yaml b/examples/hpa-single-cell/hpa_single_cell/napari.yaml new file mode 100644 index 0000000..495da56 --- /dev/null +++ b/examples/hpa-single-cell/hpa_single_cell/napari.yaml @@ -0,0 +1,12 @@ +name: hpa-single-cell +display_name: HPA Single Cell + +contributions: + commands: + - id: hpa-single-cell.QTHPASingleCell + python_name: hpa_single_cell._bhpa:QTHPASingleCell + title: HPA Single Cell + + widgets: + - command: hpa-single-cell.QTHPASingleCell + display_name: HPA Single Cell diff --git a/examples/bioimageio-hpa/pyproject.toml b/examples/hpa-single-cell/pyproject.toml similarity index 100% rename from examples/bioimageio-hpa/pyproject.toml rename to examples/hpa-single-cell/pyproject.toml diff --git a/examples/bioimageio-hpa/setup.cfg b/examples/hpa-single-cell/setup.cfg similarity index 80% rename from examples/bioimageio-hpa/setup.cfg rename to examples/hpa-single-cell/setup.cfg index dc4ef08..4c36cac 100644 --- a/examples/bioimageio-hpa/setup.cfg +++ b/examples/hpa-single-cell/setup.cfg @@ -1,5 +1,5 @@ [metadata] -name = bioimageio_hpa +name = hpa_single_cell version = 0.0.1 classifiers = Framework :: napari @@ -18,7 +18,7 @@ include_package_data = True [options.entry_points] napari.manifest = - bioimageio-hpa = bioimageio_hpa:napari.yaml + hpa-single-cell = hpa_single_cell:napari.yaml [options.package_data] -bioimageio_hpa = napari.yaml +hpa_single_cell = napari.yaml diff --git a/examples/bioimageio-hpa/setup.py b/examples/hpa-single-cell/setup.py similarity index 100% rename from examples/bioimageio-hpa/setup.py rename to examples/hpa-single-cell/setup.py diff --git a/napari_bioimageio/VERSION b/napari_bioimageio/VERSION index d917d3e..b1e80bb 100644 --- a/napari_bioimageio/VERSION +++ b/napari_bioimageio/VERSION @@ -1 +1 @@ -0.1.2 +0.1.3 diff --git a/napari_bioimageio/_bmm.py b/napari_bioimageio/_bmm.py index a3cca32..5855b16 100644 --- a/napari_bioimageio/_bmm.py +++ b/napari_bioimageio/_bmm.py @@ -429,11 +429,23 @@ def inspect_popup(self): d.exec_() def setup_ui(self): - self.resize(1080, 525) + self.resize(1080, 825) vlay_1 = QVBoxLayout(self) folderBox = QHBoxLayout() + logo_file = os.path.join( + os.path.dirname(__file__), "bioimage-io-logo-white.png" + ) + # TODO: Deal with light theme + logo_label = QLabel(f'') + folderBox.addWidget(logo_label) + folderBox.addSpacing(10) + folderBox.addStretch() + vlay_1.addLayout(folderBox) + + folderBox = QHBoxLayout() + modfol_label = QLabel("Models folder:") self.modfol_value = QLabel(self.models_folder) modfol_folder_btn = QPushButton("Change") @@ -450,6 +462,7 @@ def setup_ui(self): mov.setScaledSize(QSize(18, 18)) self.working_indicator.setMovie(mov) mov.start() + folderBox.addWidget(modfol_label) folderBox.addSpacing(10) folderBox.addWidget(self.modfol_value) @@ -481,12 +494,13 @@ def setup_ui(self): downloaded = QWidget(self.v_splitter) lay = QVBoxLayout(downloaded) lay.setContentsMargins(0, 2, 0, 2) - self.downloaded_label = QLabel("downloaded models:") + self.downloaded_label = QLabel("Downloaded models:") mid_layout = QHBoxLayout() mid_layout.addWidget(self.downloaded_label) mid_layout.addStretch() lay.addLayout(mid_layout) self.downloaded_list = QtModelList(downloaded, self, self.select_mode) + self.downloaded_list.setFixedHeight(250) lay.addWidget(self.downloaded_list) available = QWidget(self.v_splitter) @@ -498,6 +512,7 @@ def setup_ui(self): mid_layout.addStretch() lay.addLayout(mid_layout) self.available_list = QtModelList(available, self, False) + self.available_list.setFixedHeight(250) lay.addWidget(self.available_list) self.v_splitter.setStretchFactor(1, 2) diff --git a/napari_bioimageio/bioimage-io-logo-white.png b/napari_bioimageio/bioimage-io-logo-white.png new file mode 100644 index 0000000..bce5a1e Binary files /dev/null and b/napari_bioimageio/bioimage-io-logo-white.png differ diff --git a/setup.cfg b/setup.cfg index 1525d25..c0d44e4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,8 @@ [metadata] name = napari_bioimageio version = file: napari_bioimageio/VERSION +long_description = file: README.md +long_description_content_type = text/markdown; charset=UTF-8; variant=GFM classifiers = Framework :: napari Programming Language :: Python