Skip to main content

Python Version PyPI Wheel Development Status Travis Coverage Status Code style: black Gitter

brainreg

brainreg is an update to amap (itself a port of the original Java software) to include multiple registration backends, and to support the many atlases provided by bg-atlasapi.

Documentation can be found here.

Details

The aim of brainreg is to register the template brain (e.g. from the Allen Reference 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. process Overview of the registration process

Installation

pip install brainreg

Usage

Basic usage

brainreg /path/to/raw/data /path/to/output/directory -x 2 -y 2 -z 5

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 pixel sizes, see Specifying pixel size

Additional options

  • -d or --downsample 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

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.

Atlas

By default, brainreg will use the 25um version of the Allen Mouse Brain Atlas. 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.:

--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 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 "initials" form, to describe the origin voxel.

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

--orientation psl

Registration options

To change how the actual registration performs, see Registration parameters

Full command-line arguments are available with brainreg -h, but please get in touch if you have any questions.

Release files for brainreg 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for brainreg 0.0.2
File Size Uploaded
brainreg-0.0.2.tar.gz 16.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for brainreg 0.0.2
File Interpreter ABI Platform
brainreg-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 36.4 kB

Release files / brainreg-0.0.2.tar.gz

Download URL brainreg-0.0.2.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5a24a8698ccc8fe872fdaadef030a5a668285e720a11a73a2b267ef3f4399658
BLAKE2b-256 checksum
How to use checksums
9998e9845079dce67630fd4f908bbea7bee440f060e86617473c32e7e94ea6ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.10

Release files / brainreg-0.0.2-py3-none-any.whl

Download URL brainreg-0.0.2-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79edff77da6ad511bc6b6188fd15d57f19a691399b2d0930dc09f22c1c1c3fb9
BLAKE2b-256 checksum
How to use checksums
5af2663ea6346c87104177a36ae6870b0ed1013581d394db380345e5653845d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0.post20200714 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.10

Release history Release notifications | RSS feed

1.0.16

2 release files

1.0.13

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.5.1

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.13

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.3

2 release files

This release

0.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page