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

Merge brainreg-napari into brainreg #145

Merged
merged 131 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
1e137cd
initial commit
stephenlenzi Jun 25, 2021
f3dc54f
adds gui
stephenlenzi Jul 2, 2021
c81ed70
removes deprecated folder
stephenlenzi Jul 2, 2021
d974b5c
Update README.md
stephenlenzi Jul 2, 2021
7358eaa
Update README.md
stephenlenzi Jul 2, 2021
f716404
adds brainreg to requirements
stephenlenzi Jul 5, 2021
b1d247e
Merge branch 'master' of https://github.com/brainglobe/brainreg-napari
stephenlenzi Jul 5, 2021
bd54181
renames gui label from register to brainreg
stephenlenzi Jul 5, 2021
46dfeee
renames register to brainreg-register
stephenlenzi Jul 5, 2021
e1d3dc7
adds brainglobe repo to setup.py
stephenlenzi Jul 5, 2021
7ee1036
Delete requirements.txt
stephenlenzi Jul 5, 2021
ae28db8
makes output destination selectable in GUI
stephenlenzi Jul 5, 2021
46d2568
Merge branch 'master' of https://github.com/brainglobe/brainreg-napari
stephenlenzi Jul 5, 2021
4d6cfd6
Update entry point
adamltyson Jul 5, 2021
2f5bfb8
removes sort_input_file option
stephenlenzi Jul 5, 2021
39fc3e7
Update setup.py
adamltyson Jul 5, 2021
112d430
Merge branch 'master' of https://github.com/brainglobe/brainreg-napari
stephenlenzi Jul 5, 2021
d1c8ce8
updates project urls in setup.cfg
stephenlenzi Jul 5, 2021
88ea564
Update support link
adamltyson Jul 5, 2021
3fa733f
fixes output path to directory
stephenlenzi Jul 5, 2021
75c5b40
Merge branch 'master' of https://github.com/brainglobe/brainreg-napari
stephenlenzi Jul 5, 2021
9cc4a6f
re adds sort_input_file as hardcoded variable
stephenlenzi Jul 5, 2021
d8f70b4
adds atlas options as dropdown
stephenlenzi Jul 5, 2021
07c5ace
adds showing the results of registration
stephenlenzi Jul 5, 2021
0e056aa
removed a global declaration
stephenlenzi Jul 5, 2021
9d536d0
minor refactoring
stephenlenzi Jul 5, 2021
f97ca69
deleted commented code
stephenlenzi Jul 5, 2021
3e9c2da
fixes logging output
stephenlenzi Jul 7, 2021
2b377b1
only loads relevant output data
stephenlenzi Jul 7, 2021
d52e471
outputs scaled overlay of boundaries and atlas
stephenlenzi Jul 9, 2021
1036390
imports and groups segment plugin with register
stephenlenzi Jul 9, 2021
1d0db8b
lowers requirements from python >=3.7 to >=3.6 and removes project ur…
stephenlenzi Jul 13, 2021
d0b921e
removes superfluous pixel args from logging
stephenlenzi Jul 13, 2021
d383b37
Update readme, setup.py & general reformatting (#16)
adamltyson Jul 13, 2021
302f2f9
Release (#18)
adamltyson Jul 13, 2021
555beef
remove reqs from manifest
adamltyson Jul 13, 2021
43d4608
disable tests on GH actions for now
adamltyson Jul 14, 2021
62e8f8c
Merge branch 'master' of https://github.com/brainglobe/brainreg-napari
adamltyson Jul 14, 2021
7409ddf
fixes reset_defaults by ignoring atlas dropdown
stephenlenzi Jul 15, 2021
3d66347
Merge branch 'master' of https://github.com/brainglobe/brainreg-napari
stephenlenzi Jul 15, 2021
fbb9272
adds additional channels functionality
stephenlenzi Jul 16, 2021
5189514
Update OS compatibility & update use of napari API
adamltyson Jul 19, 2021
0fe4273
Bump (#23)
adamltyson Aug 2, 2021
ef8e3f6
Add tooltips (#25)
adamltyson Aug 4, 2021
9fde7e6
Bump version: 0.0.3-rc0 → 0.0.4-rc0
adamltyson Aug 4, 2021
2611320
Update README.md
adamltyson Sep 22, 2021
051524a
Update broken image URL
adamltyson Nov 26, 2021
fbd1957
Add categories and preview page workflow for the napari hub (#27)
neuromusic Dec 21, 2021
6bdd2b8
Update citation
adamltyson Jan 20, 2022
d736e50
Update README.md
adamltyson Feb 15, 2022
96b8658
Convert to npe2
dstansby May 18, 2022
a0c0e8e
Add pyqt library setup
dstansby May 18, 2022
af1dfac
Fix manifest
dstansby May 18, 2022
cbc67b6
Add basic smoke test
dstansby May 18, 2022
c182683
Merge pull request #32 from dstansby/npe2
paddyroddy May 23, 2022
243ea85
Add link to contributing guide
adamltyson May 31, 2022
70fa658
Add pre-commit
dstansby May 19, 2022
3cfd277
Fix manifest
dstansby May 19, 2022
bbfac1d
Merge pull request #34 from dstansby/pre-commit-config
dstansby Jun 10, 2022
22dc2b1
Add sample data
dstansby May 18, 2022
7e76408
Add example script
dstansby May 18, 2022
d48c6dd
Fix pre-commit and manifest
dstansby Jun 10, 2022
a804df5
Use g-node.org for sample data
dstansby Jun 20, 2022
bd9003c
Clean up example
dstansby Jun 20, 2022
6054edb
Set plugin values from metadata
dstansby Jun 20, 2022
12bec44
Add a test for sample data
dstansby Jun 20, 2022
d0b4c35
Add pooch to requirements
dstansby Jun 20, 2022
bcb0fa6
Test loading sample data through napari
dstansby Jun 20, 2022
1ee329f
Set sensible contrast limits
dstansby Jun 21, 2022
bd70185
pre-commit fixes
dstansby Jun 21, 2022
ab94d38
Merge pull request #33 from dstansby/sample-data
dstansby Jun 21, 2022
d54c00d
Add Python 3.10 support, drop 3.7 support
dstansby Jun 21, 2022
d9ef477
Add an integration test
dstansby Jun 21, 2022
4d6cdc2
Fix getting additional layers
dstansby Jun 21, 2022
6eac337
Merge pull request #36 from dstansby/integrationt-test
dstansby Jun 21, 2022
2779b78
Merge pull request #37 from dstansby/310
dstansby Jun 22, 2022
931f795
Factor out add_image_layers function
dstansby Jun 24, 2022
087503b
Remove arguments from run()
dstansby Jun 24, 2022
0daecc5
Refactor blocking/non-blocking behaviour
dstansby Jun 24, 2022
7d494ba
Store metadata in napari layers
dstansby Jun 24, 2022
06b2472
Use re-usable action for running tests
dstansby Jun 24, 2022
b45eb73
Merge pull request #39 from dstansby/reusable-txt
alessandrofelder Jun 24, 2022
e44a051
Give better name to add_image_layers
dstansby Jun 27, 2022
1bd6a11
Add error if trying to load non-existent registration
dstansby Jun 27, 2022
af19744
Return layers from add_registered_image_layers
dstansby Jun 27, 2022
bf8b5ec
Merge pull request #38 from dstansby/brainreg-metadata
dstansby Jun 29, 2022
2bf7d9e
Bump version: 0.0.4-rc0 → 0.0.5-rc0
dstansby Jun 29, 2022
053800e
Input orientation check (#44)
adamltyson Jul 26, 2022
1add991
Update readme
adamltyson Jul 26, 2022
d1b6224
format readme
adamltyson Jul 26, 2022
f068cb6
Add codecov badge
adamltyson Jul 27, 2022
de4e607
Added citation file (#45)
SimaoBolota-MetaCell Sep 28, 2022
f1ba83c
Update packaging (#46)
adamltyson Dec 6, 2022
74d0340
[Napari HUB cli] Metadata enhancement suggestions (#47)
stephenlenzi Dec 19, 2022
68c369e
Use standard pre-commit config (#51)
dstansby Feb 21, 2023
9482efd
Testing clean (#50)
dstansby Mar 20, 2023
1ce4fd2
Use selected atlas to check orientation
adamltyson Mar 21, 2023
30355b0
Add orientation check tests
adamltyson Mar 21, 2023
73da362
Merge pull request #54 from brainglobe/orientation-atlas
dstansby Mar 24, 2023
d468e87
[pre-commit.ci] pre-commit autoupdate (#57)
pre-commit-ci[bot] Jun 20, 2023
9506be7
Update links (#56)
adamltyson Jun 23, 2023
b9e32e3
Update dependency (imlib -> brainglobe-utils) (#58)
adamltyson Jun 26, 2023
c3d2589
[pre-commit.ci] pre-commit autoupdate (#59)
pre-commit-ci[bot] Jun 27, 2023
81dff62
[pre-commit.ci] pre-commit autoupdate (#60)
pre-commit-ci[bot] Jul 4, 2023
ebaca36
[pre-commit.ci] pre-commit autoupdate (#61)
pre-commit-ci[bot] Jul 11, 2023
6c80de9
[pre-commit.ci] pre-commit autoupdate (#62)
pre-commit-ci[bot] Jul 18, 2023
1f458ee
[pre-commit.ci] pre-commit autoupdate (#63)
pre-commit-ci[bot] Jul 25, 2023
2ee9dfe
[pre-commit.ci] pre-commit autoupdate (#65)
pre-commit-ci[bot] Aug 1, 2023
331adb0
[pre-commit.ci] pre-commit autoupdate (#66)
pre-commit-ci[bot] Aug 8, 2023
eae4e55
[pre-commit.ci] pre-commit autoupdate (#67)
pre-commit-ci[bot] Aug 17, 2023
d6d24c2
[pre-commit.ci] pre-commit autoupdate (#68)
pre-commit-ci[bot] Aug 22, 2023
a248303
[pre-commit.ci] pre-commit autoupdate (#70)
pre-commit-ci[bot] Aug 29, 2023
2979e7b
Update .pre-commit-config.yaml (#71)
adamltyson Aug 29, 2023
d41e01d
[pre-commit.ci] pre-commit autoupdate (#72)
pre-commit-ci[bot] Sep 5, 2023
2f6ff3e
[pre-commit.ci] pre-commit autoupdate (#74)
pre-commit-ci[bot] Oct 3, 2023
989f47a
Test on Python 3.11 (#49)
dstansby Oct 3, 2023
71f50d2
Delete .github/workflows/plugin_preview.yml (#75)
adamltyson Oct 4, 2023
06fa8fa
Write safe concat function
willGraham01 Oct 26, 2023
2939283
Use safe concat of dataframes
willGraham01 Oct 26, 2023
5551354
Fix logic of safe concat method
willGraham01 Oct 26, 2023
1ca057b
pre-commit pass
willGraham01 Oct 26, 2023
6744221
Add unit test to aplease codecov overlords
willGraham01 Oct 26, 2023
0b84f79
Restructure as brainreg/core, adjust imports accordingly
willGraham01 Oct 27, 2023
b0005f0
Make package installable again
willGraham01 Oct 27, 2023
48b441f
Fix test import
willGraham01 Oct 27, 2023
09ba645
Rework package structure to be compatible with brainreg-core
willGraham01 Oct 27, 2023
414689e
Update example code with new structure
willGraham01 Oct 27, 2023
e967d51
Merge br-napari into br-core, resolve conflicts except for READMEs
willGraham01 Oct 27, 2023
ed1f990
Rename napari plugin to drop the -napari suffix
willGraham01 Oct 27, 2023
9294d02
Merge branch 'bgv1-dev-branch' into merge-in-br-napari
willGraham01 Oct 27, 2023
0d2fd48
Exclude the to-be-reconciled READMEs from the manifest
willGraham01 Oct 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
ignore = E203, E231, W503, E722
max-line-length = 79
exclude = __init__.py,build,.eggs
10 changes: 7 additions & 3 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,22 @@ jobs:
python-version: "3.10"
- os: windows-latest
python-version: "3.9"
- os: ubuntu-latest
python-version: "3.8"

steps:
- name: Cache atlases
uses: actions/cache@v3
with:
path: ~/.brainglobe
key: atlases
- uses: neuroinformatics-unit/actions/test@v2

- name: Setup QT libraries
uses: tlambert03/setup-qt-libs@v1

- name: Run tests
uses: neuroinformatics-unit/actions/test@v2
with:
python-version: ${{ matrix.python-version }}
use-xvfb: true

test-with-conda:
needs: [linting, manifest]
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*.conf.custom

# Byte-compiled / optimized / DLL files
__pycache__/
**/__pycache__/
*.py[cod]
*$py.class

Expand Down Expand Up @@ -122,3 +122,4 @@ tests/data/test_output


*.DS_Store
pip-wheel-metadata/
7 changes: 7 additions & 0 deletions .napari/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
labels:
ontology: EDAM-BIOIMAGING:alpha06
terms:
- Image registration
- Affine registration
- Multi-channel
summary: Multi-atlas whole-brain microscopy registration
177 changes: 177 additions & 0 deletions BR-CORE-README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
[![Python Version](https://img.shields.io/pypi/pyversions/brainreg.svg)](https://pypi.org/project/brainreg)
[![PyPI](https://img.shields.io/pypi/v/brainreg.svg)](https://pypi.org/project/brainreg)
[![Wheel](https://img.shields.io/pypi/wheel/brainreg.svg)](https://pypi.org/project/brainreg)
[![Development Status](https://img.shields.io/pypi/status/brainreg.svg)](https://github.com/brainglobe/brainreg)
[![Tests](https://img.shields.io/github/workflow/status/brainglobe/brainreg/tests)](
https://github.com/brainglobe/brainreg/actions)
[![codecov](https://codecov.io/gh/brainglobe/brainreg/branch/master/graph/badge.svg?token=FbPgwBIGnd)](https://codecov.io/gh/brainglobe/brainreg)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)

# brainreg

brainreg is an update to
[amap](https://github.com/SainsburyWellcomeCentre/amap_python) (itself a port
of the [original Java software](https://www.nature.com/articles/ncomms11879))
to include multiple registration backends, and to support the many atlases
provided by [bg-atlasapi](https://github.com/brainglobe/bg-atlasapi).

Documentation can be found [here](https://brainglobe.info/documentation/brainreg/index.html).

For segmentation of bulk structures in 3D space
(e.g. injection sites, Neuropixels probes), please see
[brainreg-segment](https://github.com/brainglobe/brainreg-segment).

**N.B. There is also a [napari plugin](https://github.com/brainglobe/brainreg-napari) if you'd rather use brainreg with a graphical user interface. Currently this interface is slightly limited compared to the command line tool**

This software is at a very early stage, and was written with our data in mind.
Over time we hope to support other data types/formats. If you have any issues, please get in touch [on the forum](https://forum.image.sc/tag/brainglobe) or by
[raising an issue](https://github.com/brainglobe/brainreg/issues).

## Details

The aim of brainreg is to register the template brain
(e.g. from the [Allen Reference Atlas](https://mouse.brain-map.org/static/atlas))
to the sample image. Once this is complete, any other image in the template
space can be aligned with the sample (such as region annotations, for
segmentation of the sample image). The template to sample transformation
can also be inverted, allowing sample images to be aligned in a common
coordinate space.

To do this, the template and sample images are filtered, and then registered in
a three step process (reorientation, affine registration, and freeform
registration.) The resulting transform from template to standard space is then
applied to the atlas.

Full details of the process are in the
[original aMAP paper](https://www.nature.com/articles/ncomms11879).
![reg_process](https://user-images.githubusercontent.com/13147259/143553945-a046e918-7614-4211-814c-fc840bb0159d.png)

**Overview of the registration process**

## Installation

```bash
pip install brainreg[napari]
```

To only install the command line tool with no GUI (e.g. to run brainreg on an HPC cluster), just run:

```bash
pip install brainreg
```

**N.B. If you are using macOS, please run `conda install -c conda-forge niftyreg` to ensure all dependencies are installed.**

## Usage

### Basic usage

```bash
brainreg /path/to/raw/data /path/to/output/directory -v 5 2 2 --orientation psl
```

## Arguments

### Mandatory

* Path to the directory of the images. (Can also be a text file pointing to the files\)
* Output directory for all intermediate and final results

**You must also specify the voxel sizes, see [Specifying voxel size](https://brainglobe.info/documentation/general/image-definition.html#voxel-sizes)**

### Additional options

* `-a` or `--additional` Paths to N additional channels to downsample to the same coordinate space.
* `--sort-input-file` If set to true, the input text file will be sorted using natural sorting. This means that the file paths will be sorted as would be expected by a human and not purely alphabetically.
* `--brain_geometry` Can be one of `full` (default) for full brain registration, `hemisphere_l` for left hemisphere data-set and `hemisphere_r` for right hemisphere data-set.

#### Misc options

* `--n-free-cpus` The number of CPU cores on the machine to leave unused by the program to spare resources.
* `--debug` Debug mode. Will increase verbosity of logging and save all intermediate files for diagnosis of software issues.
* `--save-original-orientation` Option to save the registered atlas with the same orientation as the input data.

### Atlas

By default, brainreg will use the 25um version of the [Allen Mouse Brain Atlas](https://mouse.brain-map.org/). To use another atlas \(e.g. for another species, or another resolution\), you must use the `--atlas` flag, followed by the string describing the atlas, e.g.:

```bash
--atlas allen_mouse_50um
```

_To find out which atlases are available, once brainreg is installed, please run `brainglobe list`. The name of the resulting atlases is the string to pass with the `--atlas` flag._

### Registration backend

To change the registration algorithm used, use the `--backend` flag. The default is `niftyreg` as that is currently the only option.

### Input data orientation

If your data does not match the [brainglobe](https://github.com/brainglobe) default orientation \(the origin voxel is the most anterior, superior, left-most voxel, then you must specify the orientation by using the `--orientation` flag. What follows must be a string in the [bg-space](https://github.com/brainglobe/bg-space) "initials" form, to describe the origin voxel.

If the origin of your data \(first, top left voxel\) is the most anterior, superior, left part of the brain, then the orientation string would be "asl" \(anterior, superior, left\), and you would use:

```bash
--orientation asl
```

### Registration options

To change how the actual registration performs, see [Registration parameters](https://brainglobe.info/documentation/brainreg/user-guide/parameters.html)

Full command-line arguments are available with `brainreg -h`, but please
[get in touch](mailto:[email protected]?subject=brainreg) if you have any questions.

### Visualisation

brainreg comes with a plugin ([brainglobe-napari-io](https://github.com/brainglobe/brainglobe-napari-io)) for [napari](https://github.com/napari/napari) to view your data

##### Sample space

Open napari and drag your brainreg output directory (the one with the log file) onto the napari window.

Various images should then open, including:

* `Registered image` - the image used for registration, downsampled to atlas resolution
* `atlas_name` - e.g. `allen_mouse_25um` the atlas labels, warped to your sample brain
* `Boundaries` - the boundaries of the atlas regions

If you downsampled additional channels, these will also be loaded.

Most of these images will not be visible by default. Click the little eye icon to toggle visibility.

_N.B. If you use a high resolution atlas (such as `allen_mouse_10um`), then the files can take a little while to load._

![sample_space](https://raw.githubusercontent.com/brainglobe/napari-brainreg/master/resources/sample_space.gif)

##### Atlas space

`napari-brainreg` also comes with an additional plugin, for visualising your data
in atlas space.

This is typically only used in other software, but you can enable it yourself:

* Open napari
* Navigate to `Plugins` -> `Plugin Call Order`
* In the `Plugin Sorter` window, select `napari_get_reader` from the `select hook...` dropdown box
* Drag `brainreg_standard` (the atlas space viewer plugin) above `brainreg` (the normal plugin) to ensure that the atlas space plugin is used preferentially.

### Contributing

Contributions to brainreg are more than welcome. Please see the [developers guide](https://brainglobe.info/developers/index.html).

### Citing brainreg

If you find brainreg useful, and use it in your research, please let us know and also cite the paper:

> Tyson, A. L., Vélez-Fort, M., Rousseau, C. V., Cossell, L., Tsitoura, C., Lenzi, S. C., Obenhaus, H. A., Claudi, F., Branco, T., Margrie, T. W. (2022). Accurate determination of marker location within whole-brain microscopy images. Scientific Reports, 12, 867 [doi.org/10.1038/s41598-021-04676-9](https://doi.org/10.1038/s41598-021-04676-9)

Please also cite aMAP (the original pipeline from which this software is based):

>Niedworok, C.J., Brown, A.P.Y., Jorge Cardoso, M., Osten, P., Ourselin, S., Modat, M. and Margrie, T.W., (2016). AMAP is a validated pipeline for registration and segmentation of high-resolution mouse brain data. Nature Communications. 7, 1–9. <https://doi.org/10.1038/ncomms11879>

Lastly, if you can, please cite the BrainGlobe Atlas API that provided the atlas:

>Claudi, F., Petrucco, L., Tyson, A. L., Branco, T., Margrie, T. W. and Portugues, R. (2020). BrainGlobe Atlas API: a common interface for neuroanatomical atlases. Journal of Open Source Software, 5(54), 2668, <https://doi.org/10.21105/joss.02668>

**Don't forget to cite the developers of the atlas that you used (e.g. the Allen Brain Atlas)!**
75 changes: 75 additions & 0 deletions BR-NAPARI-README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
[![Python Version](https://img.shields.io/pypi/pyversions/brainreg-napari.svg)](https://pypi.org/project/brainreg-napari)
[![PyPI](https://img.shields.io/pypi/v/brainreg-napari.svg)](https://pypi.org/project/brainreg-napari)
[![Wheel](https://img.shields.io/pypi/wheel/brainreg-napari.svg)](https://pypi.org/project/brainreg-napari)
[![Development Status](https://img.shields.io/pypi/status/brainreg-napari.svg)](https://github.com/brainglobe/brainreg-napari)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
[![codecov](https://codecov.io/gh/brainglobe/brainreg-napari/branch/master/graph/badge.svg?token=HEBXJPLD2S)](https://codecov.io/gh/brainglobe/brainreg-napari)

# brainreg-napari

Napari plugin to run [brainreg](https://github.com/brainglobe/brainreg),
developed by [Stephen Lenzi](https://github.com/stephenlenzi).

## Installation

```bash
pip install brainreg-napari
```

## Usage

Documentation and tutorials for the plugin can be found [here](https://brainglobe.info/documentation/brainreg/index.html).

For segmentation of bulk structures in 3D space
(e.g. injection sites, Neuropixels probes), please see
[brainreg-segment](https://github.com/brainglobe/brainreg-segment).

This software is at a very early stage, and was written with our data in mind.
Over time we hope to support other data types/formats. If you have any issues, please get in touch [on the forum](https://forum.image.sc/tag/brainglobe) or by
[raising an issue](https://github.com/brainglobe/brainreg/issues).

## Details

brainreg is an update to
[amap](https://github.com/SainsburyWellcomeCentre/amap-python) (itself a port
of the [original Java software](https://www.nature.com/articles/ncomms11879))
to include multiple registration backends, and to support the many atlases
provided by [bg-atlasapi](https://github.com/brainglobe/bg-atlasapi).

The aim of brainreg is to register the template brain
(e.g. from the [Allen Reference Atlas](https://mouse.brain-map.org/static/atlas))
to the sample image. Once this is complete, any other image in the template
space can be aligned with the sample (such as region annotations, for
segmentation of the sample image). The template to sample transformation
can also be inverted, allowing sample images to be aligned in a common
coordinate space.

To do this, the template and sample images are filtered, and then registered in
a three step process (reorientation, affine registration, and freeform
registration.) The resulting transform from template to standard space is then
applied to the atlas.

Full details of the process are in the
[original aMAP paper](https://www.nature.com/articles/ncomms11879).
![reg_process](https://user-images.githubusercontent.com/13147259/143553945-a046e918-7614-4211-814c-fc840bb0159d.png)
**Overview of the registration process**

## Contributing

Contributions to brainreg-napari are more than welcome. Please see the [developers guide](https://brainglobe.info/developers/index.html).

### Citing brainreg

If you find brainreg useful, and use it in your research, please let us know and also cite the paper:

> Tyson, A. L., V&eacute;lez-Fort, M., Rousseau, C. V., Cossell, L., Tsitoura, C., Lenzi, S. C., Obenhaus, H. A., Claudi, F., Branco, T., Margrie, T. W. (2022). Accurate determination of marker location within whole-brain microscopy images. Scientific Reports, 12, 867 [doi.org/10.1038/s41598-021-04676-9](https://doi.org/10.1038/s41598-021-04676-9)

Please also cite aMAP (the original pipeline from which this software is based):

>Niedworok, C.J., Brown, A.P.Y., Jorge Cardoso, M., Osten, P., Ourselin, S., Modat, M. and Margrie, T.W., (2016). AMAP is a validated pipeline for registration and segmentation of high-resolution mouse brain data. Nature Communications. 7, 1–9. <https://doi.org/10.1038/ncomms11879>

Lastly, if you can, please cite the BrainGlobe Atlas API that provided the atlas:

>Claudi, F., Petrucco, L., Tyson, A. L., Branco, T., Margrie, T. W. and Portugues, R. (2020). BrainGlobe Atlas API: a common interface for neuroanatomical atlases. Journal of Open Source Software, 5(54), 2668, <https://doi.org/10.21105/joss.02668>

**Don't forget to cite the developers of the atlas that you used (e.g. the Allen Brain Atlas)!**
Loading