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 pre-processing flag and functions applicable to fMOST datastes #61

Merged
merged 15 commits into from
Nov 16, 2022

Conversation

noisysky
Copy link
Contributor

Add --pre-processing command line option, which accepts strings such as 'fmost', 'none', 'default'.
Add pre-processing functions specifically for fMOST datasets, which remove horizontal stripes and background.

@adamltyson adamltyson marked this pull request as draft May 10, 2022 09:02
@noisysky noisysky marked this pull request as ready for review May 18, 2022 19:45
@noisysky noisysky changed the title Draft: Add pre-processing flag and functions applicable to fMOST datastes Add pre-processing flag and functions applicable to fMOST datastes May 18, 2022
@adamltyson
Copy link
Member

Hey @noisysky, thanks for this PR. A couple of things:

  • OpenCV can sometimes cause installation issues on different OSs, is there a version of the function you need in numpy, scipy, scikit-image etc?
  • Could you add some tests for this new functionality?
  • Is there some example data to test this new functionality?

@noisysky noisysky force-pushed the pre-process-fmost branch from d77e0ae to c4649ab Compare June 21, 2022 16:00
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@noisysky
Copy link
Contributor Author

@adamltyson Thanks for the review!

@adamltyson
Copy link
Member

adamltyson commented Jul 21, 2022

Hey @noisysky, sorry for the very delayed response. This looks good, I've left some comments in the review.

BTW - brainreg will accept .nii files, just not the compressed versions. I want to extend this, but in the context of a general purpose I/O library (see image.sc discussion - https://forum.image.sc/t/developing-a-common-framework-to-represent-anatomical-data/68860).

Edit: This section of the contributing guide should hopefully help fix the linting issues for CI

brainreg/backend/niftyreg/run.py Outdated Show resolved Hide resolved
if preprocessing_args and preprocessing_args.preprocessing == "none":
pass
elif preprocessing_args and preprocessing_args.preprocessing == "fmost":
for i in trange(brain.shape[0], desc="filtering", unit="plane"): # only coronal plane because of stripes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the data isn't necessarily always coronal (but that seems to be the convention). Could you change the comment to reference "in-plane" or similar? It could be confusing if someone has data in another orientation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The brain at this point is always reoriented to the atlas orientation. With that comment I tried to justify why I am slicing images in the other dimension than the default pre-processing: in coronal plane stripes are most visible / easiest to remove. I removed the comment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The brain at this point is always reoriented to the atlas orientation

Good point, I forgot about this. More generally though, will this filtering hold for any fmost datasets? Are they ever acquired in other orientations, so that when reoriented to the atlas, the stripes will be in a different dimension? If not, we should at least document the requirements for fmost data.

brainreg/cli.py Show resolved Hide resolved
tests/tests/test_fmost_preprocessing.py Outdated Show resolved Hide resolved
@@ -14,6 +14,7 @@ def __init__(self, registration_output_folder):

def make_reg_paths(self):
self.downsampled_brain_path = self.make_reg_path("downsampled.tiff")
self.downsampled_filtered_brain_path = self.make_reg_path("downsampled_filtered.tiff")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linked to my above comment. Why is this file being saved?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this as well

brainreg/utils/preprocess.py Outdated Show resolved Hide resolved
@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 2, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@noisysky noisysky requested a review from adamltyson August 2, 2022 15:20
@codecov
Copy link

codecov bot commented Aug 9, 2022

Codecov Report

Base: 92.74% // Head: 92.65% // Decreases project coverage by -0.09% ⚠️

Coverage data is based on head (431bab0) compared to base (c9ef993).
Patch coverage: 90.90% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #61      +/-   ##
==========================================
- Coverage   92.74%   92.65%   -0.10%     
==========================================
  Files          13       13              
  Lines         524      531       +7     
==========================================
+ Hits          486      492       +6     
- Misses         38       39       +1     
Impacted Files Coverage Δ
brainreg/main.py 100.00% <ø> (ø)
brainreg/utils/preprocess.py 95.83% <80.00%> (-4.17%) ⬇️
brainreg/backend/niftyreg/run.py 94.44% <100.00%> (ø)
brainreg/cli.py 98.80% <100.00%> (+0.07%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@adamltyson
Copy link
Member

Hey @noisysky, this is looking in pretty good shape now (I left a few more comments). A couple more things though:

  • It would be great to add some more tests to at least make sure the test coverage % doesn't drop.
  • When running brainreg on some fmost datasets, I saw some signal missing in the downsample_filtered.nii image that's used for registration. This isn't present in the raw data (or the downsampled stack). There's also a misalignment around the cerebellum, but that's present in the raw data.
    Screenshot from 2022-08-10 13-10-28

Have you seen this before with the preprocessing?

@adamltyson
Copy link
Member

Hey @noisysky, it's been a while since we looked at this. I think we're pretty close to being able to merge this. If you don't have the time, let me know. I'll close it and we can reopen it at a later date.

@noisysky
Copy link
Contributor Author

Hi @adamltyson, there was a major problem that few z planes got almost entirely deleted. Please give me a few days to check if the new version of the processing that I have performs better on this data.

@noisysky
Copy link
Contributor Author

15257_no_bg_fft_for_PR
@adamltyson My newer version doesn't produce as bad artifacts as in your image above, but produces minor artifacts anyway. Not sure if I can improve it much. I abandoned doing background removal using standard methods, and moved on to RandomForest pixel classifiers for this purpose. Also, I noticed that fMOST align better without any pre-processing at all, compared to standard brainreg pre-processing, therefore it makes sense to keep the option of disabling the pre-processing.
I'll push the newest version of background removal that I have, and let you decide whether you want it.

@adamltyson
Copy link
Member

Also, I noticed that fMOST align better without any pre-processing at all, compared to standard brainreg pre-processing, therefore it makes sense to keep the option of disabling the pre-processing.

In that case, would you mind if I just kept the option of disabling pre-processing, and not the fMOST-specific preprocessing? Long term, I want to move away from the brainreg CLI, and move to:

  • Standard - combining brainreg napari plugin with flexible preprocessing provided by other napari plugins
  • Advanced users - using brainreg Python API along with custom preprocessing

@noisysky
Copy link
Contributor Author

@adamltyson Sure! If I have a radical improvement, I'll let you know and we'll open a new PR.

@adamltyson
Copy link
Member

Great, thanks. At some point I'll move the preprocessing into it's own module, then I'll check back to see what the current status of fmost preprocessing is.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

if preprocessing_args and preprocessing_args.preprocessing == "none":
pass
elif preprocessing_args and preprocessing_args.preprocessing == "fmost":
for i in trange(brain.shape[0], desc="filtering", unit="plane"): # only coronal plane because of stripes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The brain at this point is always reoriented to the atlas orientation

Good point, I forgot about this. More generally though, will this filtering hold for any fmost datasets? Are they ever acquired in other orientations, so that when reoriented to the atlas, the stripes will be in a different dimension? If not, we should at least document the requirements for fmost data.

brainreg/utils/preprocess.py Outdated Show resolved Hide resolved
tests/tests/test_fmost_preprocessing.py Outdated Show resolved Hide resolved
@adamltyson adamltyson merged commit 2b9474a into brainglobe:master Nov 16, 2022
willGraham01 pushed a commit that referenced this pull request Oct 27, 2023
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.276 → v0.0.277](astral-sh/ruff-pre-commit@v0.0.276...v0.0.277)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
alessandrofelder added a commit that referenced this pull request Oct 27, 2023
* initial commit

* adds gui

* removes deprecated folder

* Update README.md

* Update README.md

* adds brainreg to requirements

* renames gui label from register to brainreg

* renames register to brainreg-register

* adds brainglobe repo to setup.py

* Delete requirements.txt

* makes output destination selectable in GUI

* Update entry point

* removes sort_input_file option

* Update setup.py

* updates project urls in setup.cfg

* Update support link

* fixes output path to directory

* re adds sort_input_file as hardcoded variable

* adds atlas options as dropdown

* adds showing the results of registration

* removed a global declaration

* minor refactoring

* deleted commented code

* fixes logging output

* only loads relevant output data

* outputs scaled overlay of boundaries and atlas

* imports and groups segment plugin with register

* lowers requirements from python >=3.7 to >=3.6 and removes project url from setup.py

* removes superfluous pixel args from logging

* Update readme, setup.py & general reformatting (#16)

* update gitignore

* Update setup.py

* update readme

* format with black

* remove docs

* remove unused import

* delete tests for now

* format imports

* Release (#18)

* Update setup.py

* add bump2version config

* Bump version: 0.0.1 → 0.0.2-rc0

* remove reqs from manifest

* disable tests on GH actions for now

* fixes reset_defaults by ignoring atlas dropdown

* adds additional channels functionality

* Update OS compatibility & update use of napari API

* Bump (#23)

* Bump version: 0.0.2-rc1 → 0.0.2-rc2

* Bump version: 0.0.2-rc2 → 0.0.2-rc3

* Bump version: 0.0.2-rc3 → 0.0.3-rc0

* Add tooltips (#25)

* change default parameter names

* Add tooltips

* Bump version: 0.0.3-rc0 → 0.0.4-rc0

* Update README.md

* Update broken image URL

* Add categories and preview page workflow for the napari hub (#27)

* adds EDAM Bioimaging labels

* adds Action for napari hub preview service

* Update citation

* Update README.md

* Convert to npe2

* Add pyqt library setup

* Fix manifest

* Add basic smoke test

* Add link to contributing guide

* Add pre-commit

* Fix manifest

* Add sample data

* Add example script

* Fix pre-commit and manifest

* Use g-node.org for sample data

* Clean up example

Make noqa more specific

* Set plugin values from metadata

* Add a test for sample data

* Add pooch to requirements

Move pooch req comment

* Test loading sample data through napari

* Set sensible contrast limits

* pre-commit fixes

* Add Python 3.10 support, drop 3.7 support

* Add an integration test

Type block

* Fix getting additional layers

* Factor out add_image_layers function

* Remove arguments from run()

* Refactor blocking/non-blocking behaviour

* Store metadata in napari layers

* Use re-usable action for running tests

* Give better name to add_image_layers

* Add error if trying to load non-existent registration

* Return layers from add_registered_image_layers

* Bump version: 0.0.4-rc0 → 0.0.5-rc0

* Input orientation check (#44)

* Add many features:

- debug mode
- interactive way of checking input orientation
- brain geometry
- save annotations with original orientation

* add comments and docstring.

* Crop the reference atlas when using interactive orientation check with half brains.

* Fix a bug where run throw an error.

* Fix typo in docstrings

* format

* Add info to use if data not loaded before checking orientation

* Update docstrings

Co-authored-by: Jules Scholler <[email protected]>

* Update readme

* format readme

* Add codecov badge

* Added citation file (#45)

* Added citation file

* Changes according to PR comments

* Updated Citation file 

Updated citation file to have the preferred citation coming from the article/book when available

Co-authored-by: Simão sá <[email protected]>

* Update packaging (#46)

* update pre-commit config

* update args for new brainreg version

* lint

* update manifest

* Bump version: 0.0.5-rc0 → 0.0.5-rc1

* update testing

* update packaging

* update requirements

* update manifest

* move entry point to pyproject.toml

* update hub preview version

* update release for use with setuptools_scm

* migrate from BG to neuroinformatics actions

* add setuptools_scm to dev requirements

* reduce number of tested version

* update python versions tested

* update release

* [Napari HUB cli] Metadata enhancement suggestions (#47)

* Copy "Display Name" from secondary to primary file

Display Name was found in a secondary file and copied in the primary one:
* (found here)  "pyproject.toml"
* (copied here) "brainreg_napari/napari.yaml"

* Copy "Summary Sentence" from secondary to primary file

Summary Sentence was found in a secondary file and copied in the primary one:
* (found here)  "pyproject.toml"
* (copied here) ".napari/config.yml"

* Use standard pre-commit config (#51)

* Add standard pre-commit config

* Automated pre-commit fixes

* Testing clean (#50)

* Use composite test action

Fix use-xvfb argument

* Clean tox.ini

* Don't fail fast

* Remove old setup steps

* Clean up dev dependencies

Add pyqt5 back as a dev dep

* Try passing display env

Put back passenv in tox

* Use selected atlas to check orientation

* Add orientation check tests

* [pre-commit.ci] pre-commit autoupdate (#57)

updates:
- [github.com/charliermarsh/ruff-pre-commit: v0.0.240 → v0.0.272](astral-sh/ruff-pre-commit@v0.0.240...v0.0.272)
- [github.com/psf/black: 23.1.0 → 23.3.0](psf/black@23.1.0...23.3.0)
- [github.com/pre-commit/mirrors-mypy: v0.991 → v1.3.0](pre-commit/mirrors-mypy@v0.991...v1.3.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Update links (#56)

* Update README.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Update dependency (imlib -> brainglobe-utils) (#58)

* [pre-commit.ci] pre-commit autoupdate (#59)

updates:
- [github.com/charliermarsh/ruff-pre-commit: v0.0.272 → v0.0.275](astral-sh/ruff-pre-commit@v0.0.272...v0.0.275)
- [github.com/pre-commit/mirrors-mypy: v1.3.0 → v1.4.1](pre-commit/mirrors-mypy@v1.3.0...v1.4.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#60)

updates:
- https://github.com/charliermarsh/ruff-pre-commithttps://github.com/astral-sh/ruff-pre-commit
- [github.com/astral-sh/ruff-pre-commit: v0.0.275 → v0.0.276](astral-sh/ruff-pre-commit@v0.0.275...v0.0.276)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#61)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.276 → v0.0.277](astral-sh/ruff-pre-commit@v0.0.276...v0.0.277)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#62)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.277 → v0.0.278](astral-sh/ruff-pre-commit@v0.0.277...v0.0.278)
- [github.com/psf/black: 23.3.0 → 23.7.0](psf/black@23.3.0...23.7.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#63)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.278 → v0.0.280](astral-sh/ruff-pre-commit@v0.0.278...v0.0.280)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#65)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.280 → v0.0.281](astral-sh/ruff-pre-commit@v0.0.280...v0.0.281)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#66)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.281 → v0.0.282](astral-sh/ruff-pre-commit@v0.0.281...v0.0.282)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#67)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.282 → v0.0.284](astral-sh/ruff-pre-commit@v0.0.282...v0.0.284)
- [github.com/pre-commit/mirrors-mypy: v1.4.1 → v1.5.0](pre-commit/mirrors-mypy@v1.4.1...v1.5.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#68)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.284 → v0.0.285](astral-sh/ruff-pre-commit@v0.0.284...v0.0.285)
- [github.com/pre-commit/mirrors-mypy: v1.5.0 → v1.5.1](pre-commit/mirrors-mypy@v1.5.0...v1.5.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#70)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.285 → v0.0.286](astral-sh/ruff-pre-commit@v0.0.285...v0.0.286)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Update .pre-commit-config.yaml (#71)

* [pre-commit.ci] pre-commit autoupdate (#72)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.286 → v0.0.287](astral-sh/ruff-pre-commit@v0.0.286...v0.0.287)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#74)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.287 → v0.0.292](astral-sh/ruff-pre-commit@v0.0.287...v0.0.292)
- [github.com/psf/black: 23.7.0 → 23.9.1](psf/black@23.7.0...23.9.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Test on Python 3.11 (#49)

* Use composite test action

Fix use-xvfb argument

* Clean tox.ini

* Don't fail fast

* Remove old setup steps

* Clean up dev dependencies

Add pyqt5 back as a dev dep

* Try passing display env

Put back passenv in tox

* Test on Python 3.11

* Update Python versions

---------

Co-authored-by: Adam Tyson <[email protected]>

* Delete .github/workflows/plugin_preview.yml (#75)

* Write safe concat function

* Use safe concat of dataframes

* Fix logic of safe concat method

* pre-commit pass

* Add unit test to aplease codecov overlords

* Restructure as brainreg/core, adjust imports accordingly

* Make package installable again

* Fix test import

* Rework package structure to be compatible with brainreg-core

* Update example code with new structure

* Rename napari plugin to drop the -napari suffix

* Exclude the to-be-reconciled READMEs from the manifest

---------

Co-authored-by: stephen <[email protected]>
Co-authored-by: Adam Tyson <[email protected]>
Co-authored-by: Adam Tyson <[email protected]>
Co-authored-by: Justin Kiggins <[email protected]>
Co-authored-by: David Stansby <[email protected]>
Co-authored-by: Patrick Roddy <[email protected]>
Co-authored-by: Alessandro Felder <[email protected]>
Co-authored-by: Jules Scholler <[email protected]>
Co-authored-by: Simão Bolota <[email protected]>
Co-authored-by: Simão sá <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
alessandrofelder added a commit that referenced this pull request Nov 6, 2023
* Merge `brainreg-napari` into `brainreg` (#145)

* initial commit

* adds gui

* removes deprecated folder

* Update README.md

* Update README.md

* adds brainreg to requirements

* renames gui label from register to brainreg

* renames register to brainreg-register

* adds brainglobe repo to setup.py

* Delete requirements.txt

* makes output destination selectable in GUI

* Update entry point

* removes sort_input_file option

* Update setup.py

* updates project urls in setup.cfg

* Update support link

* fixes output path to directory

* re adds sort_input_file as hardcoded variable

* adds atlas options as dropdown

* adds showing the results of registration

* removed a global declaration

* minor refactoring

* deleted commented code

* fixes logging output

* only loads relevant output data

* outputs scaled overlay of boundaries and atlas

* imports and groups segment plugin with register

* lowers requirements from python >=3.7 to >=3.6 and removes project url from setup.py

* removes superfluous pixel args from logging

* Update readme, setup.py & general reformatting (#16)

* update gitignore

* Update setup.py

* update readme

* format with black

* remove docs

* remove unused import

* delete tests for now

* format imports

* Release (#18)

* Update setup.py

* add bump2version config

* Bump version: 0.0.1 → 0.0.2-rc0

* remove reqs from manifest

* disable tests on GH actions for now

* fixes reset_defaults by ignoring atlas dropdown

* adds additional channels functionality

* Update OS compatibility & update use of napari API

* Bump (#23)

* Bump version: 0.0.2-rc1 → 0.0.2-rc2

* Bump version: 0.0.2-rc2 → 0.0.2-rc3

* Bump version: 0.0.2-rc3 → 0.0.3-rc0

* Add tooltips (#25)

* change default parameter names

* Add tooltips

* Bump version: 0.0.3-rc0 → 0.0.4-rc0

* Update README.md

* Update broken image URL

* Add categories and preview page workflow for the napari hub (#27)

* adds EDAM Bioimaging labels

* adds Action for napari hub preview service

* Update citation

* Update README.md

* Convert to npe2

* Add pyqt library setup

* Fix manifest

* Add basic smoke test

* Add link to contributing guide

* Add pre-commit

* Fix manifest

* Add sample data

* Add example script

* Fix pre-commit and manifest

* Use g-node.org for sample data

* Clean up example

Make noqa more specific

* Set plugin values from metadata

* Add a test for sample data

* Add pooch to requirements

Move pooch req comment

* Test loading sample data through napari

* Set sensible contrast limits

* pre-commit fixes

* Add Python 3.10 support, drop 3.7 support

* Add an integration test

Type block

* Fix getting additional layers

* Factor out add_image_layers function

* Remove arguments from run()

* Refactor blocking/non-blocking behaviour

* Store metadata in napari layers

* Use re-usable action for running tests

* Give better name to add_image_layers

* Add error if trying to load non-existent registration

* Return layers from add_registered_image_layers

* Bump version: 0.0.4-rc0 → 0.0.5-rc0

* Input orientation check (#44)

* Add many features:

- debug mode
- interactive way of checking input orientation
- brain geometry
- save annotations with original orientation

* add comments and docstring.

* Crop the reference atlas when using interactive orientation check with half brains.

* Fix a bug where run throw an error.

* Fix typo in docstrings

* format

* Add info to use if data not loaded before checking orientation

* Update docstrings

Co-authored-by: Jules Scholler <[email protected]>

* Update readme

* format readme

* Add codecov badge

* Added citation file (#45)

* Added citation file

* Changes according to PR comments

* Updated Citation file 

Updated citation file to have the preferred citation coming from the article/book when available

Co-authored-by: Simão sá <[email protected]>

* Update packaging (#46)

* update pre-commit config

* update args for new brainreg version

* lint

* update manifest

* Bump version: 0.0.5-rc0 → 0.0.5-rc1

* update testing

* update packaging

* update requirements

* update manifest

* move entry point to pyproject.toml

* update hub preview version

* update release for use with setuptools_scm

* migrate from BG to neuroinformatics actions

* add setuptools_scm to dev requirements

* reduce number of tested version

* update python versions tested

* update release

* [Napari HUB cli] Metadata enhancement suggestions (#47)

* Copy "Display Name" from secondary to primary file

Display Name was found in a secondary file and copied in the primary one:
* (found here)  "pyproject.toml"
* (copied here) "brainreg_napari/napari.yaml"

* Copy "Summary Sentence" from secondary to primary file

Summary Sentence was found in a secondary file and copied in the primary one:
* (found here)  "pyproject.toml"
* (copied here) ".napari/config.yml"

* Use standard pre-commit config (#51)

* Add standard pre-commit config

* Automated pre-commit fixes

* Testing clean (#50)

* Use composite test action

Fix use-xvfb argument

* Clean tox.ini

* Don't fail fast

* Remove old setup steps

* Clean up dev dependencies

Add pyqt5 back as a dev dep

* Try passing display env

Put back passenv in tox

* Use selected atlas to check orientation

* Add orientation check tests

* [pre-commit.ci] pre-commit autoupdate (#57)

updates:
- [github.com/charliermarsh/ruff-pre-commit: v0.0.240 → v0.0.272](astral-sh/ruff-pre-commit@v0.0.240...v0.0.272)
- [github.com/psf/black: 23.1.0 → 23.3.0](psf/black@23.1.0...23.3.0)
- [github.com/pre-commit/mirrors-mypy: v0.991 → v1.3.0](pre-commit/mirrors-mypy@v0.991...v1.3.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Update links (#56)

* Update README.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Update dependency (imlib -> brainglobe-utils) (#58)

* [pre-commit.ci] pre-commit autoupdate (#59)

updates:
- [github.com/charliermarsh/ruff-pre-commit: v0.0.272 → v0.0.275](astral-sh/ruff-pre-commit@v0.0.272...v0.0.275)
- [github.com/pre-commit/mirrors-mypy: v1.3.0 → v1.4.1](pre-commit/mirrors-mypy@v1.3.0...v1.4.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#60)

updates:
- https://github.com/charliermarsh/ruff-pre-commithttps://github.com/astral-sh/ruff-pre-commit
- [github.com/astral-sh/ruff-pre-commit: v0.0.275 → v0.0.276](astral-sh/ruff-pre-commit@v0.0.275...v0.0.276)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#61)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.276 → v0.0.277](astral-sh/ruff-pre-commit@v0.0.276...v0.0.277)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#62)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.277 → v0.0.278](astral-sh/ruff-pre-commit@v0.0.277...v0.0.278)
- [github.com/psf/black: 23.3.0 → 23.7.0](psf/black@23.3.0...23.7.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#63)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.278 → v0.0.280](astral-sh/ruff-pre-commit@v0.0.278...v0.0.280)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#65)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.280 → v0.0.281](astral-sh/ruff-pre-commit@v0.0.280...v0.0.281)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#66)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.281 → v0.0.282](astral-sh/ruff-pre-commit@v0.0.281...v0.0.282)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#67)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.282 → v0.0.284](astral-sh/ruff-pre-commit@v0.0.282...v0.0.284)
- [github.com/pre-commit/mirrors-mypy: v1.4.1 → v1.5.0](pre-commit/mirrors-mypy@v1.4.1...v1.5.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#68)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.284 → v0.0.285](astral-sh/ruff-pre-commit@v0.0.284...v0.0.285)
- [github.com/pre-commit/mirrors-mypy: v1.5.0 → v1.5.1](pre-commit/mirrors-mypy@v1.5.0...v1.5.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#70)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.285 → v0.0.286](astral-sh/ruff-pre-commit@v0.0.285...v0.0.286)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Update .pre-commit-config.yaml (#71)

* [pre-commit.ci] pre-commit autoupdate (#72)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.286 → v0.0.287](astral-sh/ruff-pre-commit@v0.0.286...v0.0.287)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#74)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.0.287 → v0.0.292](astral-sh/ruff-pre-commit@v0.0.287...v0.0.292)
- [github.com/psf/black: 23.7.0 → 23.9.1](psf/black@23.7.0...23.9.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Test on Python 3.11 (#49)

* Use composite test action

Fix use-xvfb argument

* Clean tox.ini

* Don't fail fast

* Remove old setup steps

* Clean up dev dependencies

Add pyqt5 back as a dev dep

* Try passing display env

Put back passenv in tox

* Test on Python 3.11

* Update Python versions

---------

Co-authored-by: Adam Tyson <[email protected]>

* Delete .github/workflows/plugin_preview.yml (#75)

* Write safe concat function

* Use safe concat of dataframes

* Fix logic of safe concat method

* pre-commit pass

* Add unit test to aplease codecov overlords

* Restructure as brainreg/core, adjust imports accordingly

* Make package installable again

* Fix test import

* Rework package structure to be compatible with brainreg-core

* Update example code with new structure

* Rename napari plugin to drop the -napari suffix

* Exclude the to-be-reconciled READMEs from the manifest

---------

Co-authored-by: stephen <[email protected]>
Co-authored-by: Adam Tyson <[email protected]>
Co-authored-by: Adam Tyson <[email protected]>
Co-authored-by: Justin Kiggins <[email protected]>
Co-authored-by: David Stansby <[email protected]>
Co-authored-by: Patrick Roddy <[email protected]>
Co-authored-by: Alessandro Felder <[email protected]>
Co-authored-by: Jules Scholler <[email protected]>
Co-authored-by: Simão Bolota <[email protected]>
Co-authored-by: Simão sá <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Reconcile the `core` and `napari` READMEs (#147)

* Parse existing brainreg readme

* Incorporate plugin readme and update manifest

* Apply Adam's updates

Co-authored-by: Adam Tyson <[email protected]>

---------

Co-authored-by: Adam Tyson <[email protected]>

* Reconcile the `core` and `napari` READMEs (#147)

* Parse existing brainreg readme

* Incorporate plugin readme and update manifest

* Apply Adam's updates

Co-authored-by: Adam Tyson <[email protected]>

---------

Co-authored-by: Adam Tyson <[email protected]>

* Update README.md

* Update with brainreg-segment rename to brainglobe-segmentation (#149)

* Update with brainreg-segment rename to brainglobe-segmentation

* Update pyproject.toml

---------

Co-authored-by: stephen <[email protected]>
Co-authored-by: Adam Tyson <[email protected]>
Co-authored-by: Adam Tyson <[email protected]>
Co-authored-by: Justin Kiggins <[email protected]>
Co-authored-by: David Stansby <[email protected]>
Co-authored-by: Patrick Roddy <[email protected]>
Co-authored-by: Alessandro Felder <[email protected]>
Co-authored-by: Jules Scholler <[email protected]>
Co-authored-by: Simão Bolota <[email protected]>
Co-authored-by: Simão sá <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants