From 4a2c551af01354fc37da7dea0c14c63a6ec7eda8 Mon Sep 17 00:00:00 2001 From: willGraham01 <1willgraham@gmail.com> Date: Tue, 2 Jan 2024 11:51:43 +0000 Subject: [PATCH] Update cellfinder CLI name to brainmapper --- README.md | 32 +++++++++---------- .../__init__.py | 0 .../analyse/__init__.py | 0 .../analyse/analyse.py | 2 +- .../export/__init__.py | 0 .../export/abc4d.py | 0 .../export/brainrender.py | 0 .../export/export.py | 4 +-- .../extract/__init__.py | 0 .../extract/extract_cubes.py | 4 +-- .../figures/__init__.py | 0 .../figures/figures.py | 2 +- .../figures/heatmap.py | 0 .../main.py | 8 ++--- .../tools/__init__.py | 0 .../tools/image_processing.py | 0 .../tools/parser.py | 0 .../tools/prep.py | 6 ++-- .../tools/system.py | 0 .../tools/tools.py | 0 pyproject.toml | 2 +- .../test_integration/test_detection.py | 2 +- .../test_integration/test_extract.py | 2 +- .../test_integration/test_registration.py | 2 +- .../test_unit/test_analyse.py | 2 +- .../test_tools/test_image_processing.py | 2 +- .../test_unit/test_tools/test_prep.py | 2 +- .../test_unit/test_tools/test_system.py | 2 +- .../test_tools/test_tools_general.py | 2 +- 29 files changed, 38 insertions(+), 38 deletions(-) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/__init__.py (100%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/analyse/__init__.py (100%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/analyse/analyse.py (99%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/export/__init__.py (100%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/export/abc4d.py (100%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/export/brainrender.py (100%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/export/export.py (68%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/extract/__init__.py (100%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/extract/extract_cubes.py (99%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/figures/__init__.py (100%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/figures/figures.py (83%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/figures/heatmap.py (100%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/main.py (96%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/tools/__init__.py (100%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/tools/image_processing.py (100%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/tools/parser.py (100%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/tools/prep.py (98%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/tools/system.py (100%) rename brainglobe_workflows/{cellfinder_brainreg => brainmapper}/tools/tools.py (100%) diff --git a/README.md b/README.md index 8164964b..38b7d55f 100644 --- a/README.md +++ b/README.md @@ -24,15 +24,15 @@ You can also find the documentation for the backend BrainGlobe tools these workf At present, the package offers the following workflows to users: -- [cellfinder](#cellfinder): a command-line tool for whole-brain detection, registration, and analysis. +- [brainmapper](#brainmapper-command-line-interface-cli): A command-line tool for whole-brain detection, registration, and analysis. -Additionally, this repository provides functionalities to support code developers. See [Developers documentation](#developers-documentation) for further details. +Additionally, this repository provides functionalities to support code developers. See the [developer documentation](#developer-documentation) for further details. ## User documentation +### Installation -### Installation of the cellfinder CLI tool -At the moment, users can install the cellfinder CLI tool as a standalone tool, by running `pip install` in your desired environment: +At the moment, users can install all available workflows by running `pip install` in your desired environment: ```bash pip install brainglobe-workflows @@ -41,43 +41,45 @@ pip install brainglobe-workflows `brainglobe-workflows` is built using BrainGlobe tools, and it will automatically fetch the tools that it needs and install them into your environment. Once BrainGlobe version 1 is available, this package will fetch all BrainGlobe tools and handle their install into your environment, to prevent potential conflicts from partial-installs. +See the sections below for more information about the workflows and command-line tools provided. -### Cellfinder Command Line Interface (CLI) +#### `brainmapper` Command Line Interface (CLI) Whole-brain cell detection, registration and analysis. -If you want to just use the cell detection part of `cellfinder`, please see the standalone [cellfinder](https://github.com/brainglobe/cellfinder-core) package, or the [cellfinder plugin](https://github.com/brainglobe/cellfinder-napari) for [napari](https://napari.org/). - +If you want to just use the cell detection part of `brainmapper`, please see the standalone [cellfinder](https://github.com/brainglobe/cellfinder) package and its [`napari`](https://napari.org/) plugin. `cellfinder` is a collection of tools developed by [Adam Tyson](https://github.com/adamltyson), [Charly Rousseau](https://github.com/crousseau) and [Christian Niedworok](https://github.com/cniedwor) in the [Margrie Lab](https://www.sainsburywellcome.org/web/groups/margrie-lab), generously supported by the [Sainsbury Wellcome Centre](https://www.sainsburywellcome.org/web/). -`cellfinder` is designed for the analysis of whole-brain imaging data such as [serial-section imaging](https://sainsburywellcomecentre.github.io/OpenSerialSection/) and lightsheet imaging in cleared tissue. +`brainmapper` is a workflow designed for the analysis of whole-brain imaging data such as [serial-section imaging](https://sainsburywellcomecentre.github.io/OpenSerialSection/) and lightsheet imaging in cleared tissue. The aim is to provide a single solution for: -- Cell detection (initial cell candidate detection and refinement using deep learning) (using the [cellfinder](https://github.com/brainglobe/cellfinder-core) backend package), +- Cell detection (initial cell candidate detection and refinement using deep learning) (using the [cellfinder](https://github.com/brainglobe/cellfinder) backend package), - Atlas registration (using [brainreg](https://github.com/brainglobe/brainreg)), - Analysis of cell positions in a common space. Basic usage: ```bash -cellfinder -s signal_images -b background_images -o output_dir --metadata metadata +brainmapper -s signal_images -b background_images -o output_dir --metadata metadata ``` Full documentation can be found [here](https://brainglobe.info/documentation/cellfinder/index.html). +NOTE: The `brainmapper` workflow previously used the name "cellfinder", but this has been discontinued following the release of the [unified `cellfinder`](https://github.com/brainglobe/cellfinder) backend package to avoid conflation of terms. +See our [blog post](https://brainglobe.info/blog/version1/cellfinder-core-and-plugin-merge.html) from the release for more information. ## Developer documentation This repository also includes workflow scripts that are benchmarked to support code development. These benchmarks are run regularly to ensure performance is stable, as the tools are developed and extended. -* Developers can install these benchmarks locally via `pip install .[dev]`. By executing `asv run`, the benchmarks will run with default parameters on a small dataset that is downloaded from [GIN](https://gin.g-node.org/G-Node/info/wiki). See [the asv docs](https://asv.readthedocs.io/en/v0.6.1/using.html#running-benchmarks) for further details on how to run benchmarks. -* Developers can also run these benchmarks on data they have stored locally, by specifying the relevant paths in an input (JSON) file. -* We also maintain an internal runner that benchmarks the workflows over a large, exemplar dataset, of the scale we expect users to be handling. The result of these benchmarks are made publicly available. + +- Developers can install these benchmarks locally via `pip install .[dev]`. By executing `asv run`, the benchmarks will run with default parameters on a small dataset that is downloaded from [GIN](https://gin.g-node.org/G-Node/info/wiki). See [the asv docs](https://asv.readthedocs.io/en/v0.6.1/using.html#running-benchmarks) for further details on how to run benchmarks. +- Developers can also run these benchmarks on data they have stored locally, by specifying the relevant paths in an input (JSON) file. +- We also maintain an internal runner that benchmarks the workflows over a large, exemplar dataset, of the scale we expect users to be handling. The result of these benchmarks are made publicly available. Contributions to BrainGlobe are more than welcome. Please see the [developer guide](https://brainglobe.info/developers/index.html). - ## Citing `brainglobe-workflows` **If you use any tools in the [brainglobe suite](https://brainglobe.info/documentation/index.html), please [let us know](mailto:code@adamltyson.com?subject=cellfinder), and we'd be happy to promote your paper/talk etc.** @@ -87,5 +89,3 @@ If you find [`cellfinder`](#cellfinder) useful, and use it in your research, ple [https://doi.org/10.1371/journal.pcbi.1009074](https://doi.org/10.1371/journal.pcbi.1009074) > If you use any of the image registration functions in `cellfinder`, please also cite [`brainreg`](https://github.com/brainglobe/brainreg#citing-brainreg). - ---- diff --git a/brainglobe_workflows/cellfinder_brainreg/__init__.py b/brainglobe_workflows/brainmapper/__init__.py similarity index 100% rename from brainglobe_workflows/cellfinder_brainreg/__init__.py rename to brainglobe_workflows/brainmapper/__init__.py diff --git a/brainglobe_workflows/cellfinder_brainreg/analyse/__init__.py b/brainglobe_workflows/brainmapper/analyse/__init__.py similarity index 100% rename from brainglobe_workflows/cellfinder_brainreg/analyse/__init__.py rename to brainglobe_workflows/brainmapper/analyse/__init__.py diff --git a/brainglobe_workflows/cellfinder_brainreg/analyse/analyse.py b/brainglobe_workflows/brainmapper/analyse/analyse.py similarity index 99% rename from brainglobe_workflows/cellfinder_brainreg/analyse/analyse.py rename to brainglobe_workflows/brainmapper/analyse/analyse.py index 822eaf89..cd517b14 100644 --- a/brainglobe_workflows/cellfinder_brainreg/analyse/analyse.py +++ b/brainglobe_workflows/brainmapper/analyse/analyse.py @@ -18,7 +18,7 @@ from brainglobe_utils.general.system import ensure_directory_exists from brainglobe_utils.pandas.misc import safe_pandas_concat, sanitise_df -from brainglobe_workflows.cellfinder_brainreg.export.export import ( +from brainglobe_workflows.brainmapper.export.export import ( export_points, ) diff --git a/brainglobe_workflows/cellfinder_brainreg/export/__init__.py b/brainglobe_workflows/brainmapper/export/__init__.py similarity index 100% rename from brainglobe_workflows/cellfinder_brainreg/export/__init__.py rename to brainglobe_workflows/brainmapper/export/__init__.py diff --git a/brainglobe_workflows/cellfinder_brainreg/export/abc4d.py b/brainglobe_workflows/brainmapper/export/abc4d.py similarity index 100% rename from brainglobe_workflows/cellfinder_brainreg/export/abc4d.py rename to brainglobe_workflows/brainmapper/export/abc4d.py diff --git a/brainglobe_workflows/cellfinder_brainreg/export/brainrender.py b/brainglobe_workflows/brainmapper/export/brainrender.py similarity index 100% rename from brainglobe_workflows/cellfinder_brainreg/export/brainrender.py rename to brainglobe_workflows/brainmapper/export/brainrender.py diff --git a/brainglobe_workflows/cellfinder_brainreg/export/export.py b/brainglobe_workflows/brainmapper/export/export.py similarity index 68% rename from brainglobe_workflows/cellfinder_brainreg/export/export.py rename to brainglobe_workflows/brainmapper/export/export.py index c40eaf95..4f43a47f 100644 --- a/brainglobe_workflows/cellfinder_brainreg/export/export.py +++ b/brainglobe_workflows/brainmapper/export/export.py @@ -1,7 +1,7 @@ -from brainglobe_workflows.cellfinder_brainreg.export.abc4d import ( +from brainglobe_workflows.brainmapper.export.abc4d import ( export_points as abc4d_export, ) -from brainglobe_workflows.cellfinder_brainreg.export.brainrender import ( +from brainglobe_workflows.brainmapper.export.brainrender import ( export_points as brainrender_export, ) diff --git a/brainglobe_workflows/cellfinder_brainreg/extract/__init__.py b/brainglobe_workflows/brainmapper/extract/__init__.py similarity index 100% rename from brainglobe_workflows/cellfinder_brainreg/extract/__init__.py rename to brainglobe_workflows/brainmapper/extract/__init__.py diff --git a/brainglobe_workflows/cellfinder_brainreg/extract/extract_cubes.py b/brainglobe_workflows/brainmapper/extract/extract_cubes.py similarity index 99% rename from brainglobe_workflows/cellfinder_brainreg/extract/extract_cubes.py rename to brainglobe_workflows/brainmapper/extract/extract_cubes.py index 5a19593b..8e69430a 100644 --- a/brainglobe_workflows/cellfinder_brainreg/extract/extract_cubes.py +++ b/brainglobe_workflows/brainmapper/extract/extract_cubes.py @@ -22,10 +22,10 @@ from tifffile import tifffile from tqdm import tqdm -from brainglobe_workflows.cellfinder_brainreg.tools import ( +from brainglobe_workflows.brainmapper.tools import ( image_processing as img_tools, ) -from brainglobe_workflows.cellfinder_brainreg.tools import system +from brainglobe_workflows.brainmapper.tools import system class StackSizeError(Exception): diff --git a/brainglobe_workflows/cellfinder_brainreg/figures/__init__.py b/brainglobe_workflows/brainmapper/figures/__init__.py similarity index 100% rename from brainglobe_workflows/cellfinder_brainreg/figures/__init__.py rename to brainglobe_workflows/brainmapper/figures/__init__.py diff --git a/brainglobe_workflows/cellfinder_brainreg/figures/figures.py b/brainglobe_workflows/brainmapper/figures/figures.py similarity index 83% rename from brainglobe_workflows/cellfinder_brainreg/figures/figures.py rename to brainglobe_workflows/brainmapper/figures/figures.py index 491e5ac3..d36d5573 100644 --- a/brainglobe_workflows/cellfinder_brainreg/figures/figures.py +++ b/brainglobe_workflows/brainmapper/figures/figures.py @@ -1,6 +1,6 @@ import logging -from brainglobe_workflows.cellfinder_brainreg.figures import heatmap +from brainglobe_workflows.brainmapper.figures import heatmap def run(args, atlas, downsampled_shape): diff --git a/brainglobe_workflows/cellfinder_brainreg/figures/heatmap.py b/brainglobe_workflows/brainmapper/figures/heatmap.py similarity index 100% rename from brainglobe_workflows/cellfinder_brainreg/figures/heatmap.py rename to brainglobe_workflows/brainmapper/figures/heatmap.py diff --git a/brainglobe_workflows/cellfinder_brainreg/main.py b/brainglobe_workflows/brainmapper/main.py similarity index 96% rename from brainglobe_workflows/cellfinder_brainreg/main.py rename to brainglobe_workflows/brainmapper/main.py index 4e77662b..1c673be5 100644 --- a/brainglobe_workflows/cellfinder_brainreg/main.py +++ b/brainglobe_workflows/brainmapper/main.py @@ -44,7 +44,7 @@ def main(): suppress_tf_logging(tf_suppress_log_messages) from brainreg.core.main import main as register - from brainglobe_workflows.cellfinder_brainreg.tools import prep + from brainglobe_workflows.brainmapper.tools import prep start_time = datetime.now() args, arg_groups, what_to_run, atlas = prep.prep_cellfinder_general() @@ -105,9 +105,9 @@ def run_all(args, what_to_run, atlas): from cellfinder.core.tools import prep from cellfinder.core.tools.IO import read_with_dask - from brainglobe_workflows.cellfinder_brainreg.analyse import analyse - from brainglobe_workflows.cellfinder_brainreg.figures import figures - from brainglobe_workflows.cellfinder_brainreg.tools.prep import ( + from brainglobe_workflows.brainmapper.analyse import analyse + from brainglobe_workflows.brainmapper.figures import figures + from brainglobe_workflows.brainmapper.tools.prep import ( prep_candidate_detection, prep_channel_specific_general, ) diff --git a/brainglobe_workflows/cellfinder_brainreg/tools/__init__.py b/brainglobe_workflows/brainmapper/tools/__init__.py similarity index 100% rename from brainglobe_workflows/cellfinder_brainreg/tools/__init__.py rename to brainglobe_workflows/brainmapper/tools/__init__.py diff --git a/brainglobe_workflows/cellfinder_brainreg/tools/image_processing.py b/brainglobe_workflows/brainmapper/tools/image_processing.py similarity index 100% rename from brainglobe_workflows/cellfinder_brainreg/tools/image_processing.py rename to brainglobe_workflows/brainmapper/tools/image_processing.py diff --git a/brainglobe_workflows/cellfinder_brainreg/tools/parser.py b/brainglobe_workflows/brainmapper/tools/parser.py similarity index 100% rename from brainglobe_workflows/cellfinder_brainreg/tools/parser.py rename to brainglobe_workflows/brainmapper/tools/parser.py diff --git a/brainglobe_workflows/cellfinder_brainreg/tools/prep.py b/brainglobe_workflows/brainmapper/tools/prep.py similarity index 98% rename from brainglobe_workflows/cellfinder_brainreg/tools/prep.py rename to brainglobe_workflows/brainmapper/tools/prep.py index 318f28b8..63337ce1 100644 --- a/brainglobe_workflows/cellfinder_brainreg/tools/prep.py +++ b/brainglobe_workflows/brainmapper/tools/prep.py @@ -18,9 +18,9 @@ from fancylog import fancylog import brainglobe_workflows as program_for_log -import brainglobe_workflows.cellfinder_brainreg.tools.parser as parser -from brainglobe_workflows.cellfinder_brainreg.tools import system, tools -from brainglobe_workflows.cellfinder_brainreg.tools.parser import ( +import brainglobe_workflows.brainmapper.tools.parser as parser +from brainglobe_workflows.brainmapper.tools import system, tools +from brainglobe_workflows.brainmapper.tools.parser import ( cellfinder_parser, ) diff --git a/brainglobe_workflows/cellfinder_brainreg/tools/system.py b/brainglobe_workflows/brainmapper/tools/system.py similarity index 100% rename from brainglobe_workflows/cellfinder_brainreg/tools/system.py rename to brainglobe_workflows/brainmapper/tools/system.py diff --git a/brainglobe_workflows/cellfinder_brainreg/tools/tools.py b/brainglobe_workflows/brainmapper/tools/tools.py similarity index 100% rename from brainglobe_workflows/cellfinder_brainreg/tools/tools.py rename to brainglobe_workflows/brainmapper/tools/tools.py diff --git a/pyproject.toml b/pyproject.toml index 63edea2c..f713dffb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,7 +74,7 @@ napari = ["napari[pyqt5]", "brainglobe-napari-io", "cellfinder[napari]>=1.0.0"] [project.scripts] cellfinder-workflow = "brainglobe_workflows.cellfinder_core.cellfinder:main_app_wrapper" -cellfinder = "brainglobe_workflows.cellfinder_brainreg.main:main" +brainmapper = "brainglobe_workflows.brainmapper.main:main" [build-system] requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"] diff --git a/tests/cellfinder_brainreg/test_integration/test_detection.py b/tests/cellfinder_brainreg/test_integration/test_detection.py index 4e3c683c..507081b5 100644 --- a/tests/cellfinder_brainreg/test_integration/test_detection.py +++ b/tests/cellfinder_brainreg/test_integration/test_detection.py @@ -6,7 +6,7 @@ import brainglobe_utils.IO.cells as cell_io import pytest -from brainglobe_workflows.cellfinder_brainreg.main import ( +from brainglobe_workflows.brainmapper.main import ( main as cellfinder_run, ) diff --git a/tests/cellfinder_brainreg/test_integration/test_extract.py b/tests/cellfinder_brainreg/test_integration/test_extract.py index 927760f6..3bb08390 100644 --- a/tests/cellfinder_brainreg/test_integration/test_extract.py +++ b/tests/cellfinder_brainreg/test_integration/test_extract.py @@ -12,7 +12,7 @@ from brainglobe_utils.IO.cells import get_cells from tifffile import tifffile -from brainglobe_workflows.cellfinder_brainreg.extract import ( +from brainglobe_workflows.brainmapper.extract import ( extract_cubes as extract_cubes, ) diff --git a/tests/cellfinder_brainreg/test_integration/test_registration.py b/tests/cellfinder_brainreg/test_integration/test_registration.py index ea89f26a..c8aa302c 100644 --- a/tests/cellfinder_brainreg/test_integration/test_registration.py +++ b/tests/cellfinder_brainreg/test_integration/test_registration.py @@ -7,7 +7,7 @@ import pytest from imio.load import load_any -from brainglobe_workflows.cellfinder_brainreg.main import ( +from brainglobe_workflows.brainmapper.main import ( main as cellfinder_run, ) diff --git a/tests/cellfinder_brainreg/test_unit/test_analyse.py b/tests/cellfinder_brainreg/test_unit/test_analyse.py index b61f44df..f98bf0c8 100644 --- a/tests/cellfinder_brainreg/test_unit/test_analyse.py +++ b/tests/cellfinder_brainreg/test_unit/test_analyse.py @@ -4,7 +4,7 @@ import pytest -from brainglobe_workflows.cellfinder_brainreg.analyse.analyse import ( +from brainglobe_workflows.brainmapper.analyse.analyse import ( Point, get_region_totals, ) diff --git a/tests/cellfinder_brainreg/test_unit/test_tools/test_image_processing.py b/tests/cellfinder_brainreg/test_unit/test_tools/test_image_processing.py index d54a371c..56e9f7fd 100644 --- a/tests/cellfinder_brainreg/test_unit/test_tools/test_image_processing.py +++ b/tests/cellfinder_brainreg/test_unit/test_tools/test_image_processing.py @@ -2,7 +2,7 @@ import numpy as np -from brainglobe_workflows.cellfinder_brainreg.tools import ( +from brainglobe_workflows.brainmapper.tools import ( image_processing as img_tools, ) diff --git a/tests/cellfinder_brainreg/test_unit/test_tools/test_prep.py b/tests/cellfinder_brainreg/test_unit/test_tools/test_prep.py index 2ff1b2da..225ab5a0 100644 --- a/tests/cellfinder_brainreg/test_unit/test_tools/test_prep.py +++ b/tests/cellfinder_brainreg/test_unit/test_tools/test_prep.py @@ -3,7 +3,7 @@ import pytest from brainglobe_utils.general.exceptions import CommandLineInputError -from brainglobe_workflows.cellfinder_brainreg.tools import prep +from brainglobe_workflows.brainmapper.tools import prep # import shutil diff --git a/tests/cellfinder_brainreg/test_unit/test_tools/test_system.py b/tests/cellfinder_brainreg/test_unit/test_tools/test_system.py index d2834d51..9ce5d5c1 100644 --- a/tests/cellfinder_brainreg/test_unit/test_tools/test_system.py +++ b/tests/cellfinder_brainreg/test_unit/test_tools/test_system.py @@ -6,7 +6,7 @@ from brainglobe_utils.general.exceptions import CommandLineInputError from brainglobe_utils.general.system import ensure_directory_exists -import brainglobe_workflows.cellfinder_brainreg.tools.system as system +import brainglobe_workflows.brainmapper.tools.system as system data_dir = Path(__file__).parents[4] / Path("tests", "data") background_im_dir = os.path.join(data_dir, "background") diff --git a/tests/cellfinder_brainreg/test_unit/test_tools/test_tools_general.py b/tests/cellfinder_brainreg/test_unit/test_tools/test_tools_general.py index 10fb3c18..a29ffc4b 100644 --- a/tests/cellfinder_brainreg/test_unit/test_tools/test_tools_general.py +++ b/tests/cellfinder_brainreg/test_unit/test_tools/test_tools_general.py @@ -3,7 +3,7 @@ import numpy as np import pytest -import brainglobe_workflows.cellfinder_brainreg.tools.tools as tools +import brainglobe_workflows.brainmapper.tools.tools as tools a = [1, "a", 10, 30] b = [30, 10, "c", "d"]