You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: amap/installation.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ Remember to activate your conda environment before doing anything
48
48
pip install amap
49
49
```
50
50
51
-
## Download atlas and trained classification models \(optional\)
51
+
## Download atlas \(optional\)
52
52
53
53
When you run amap, it will download the files it needs \(e.g. the atlas\). If you want to save time later, or you know you won't have an internet connection when you run amap you can download these in advance. See [downloading files](downloading-files.md) for details.
Full command-line arguments are available with `amap -h`
14
+
Full command-line arguments are available with `brainreg -h`
15
15
{% endhint %}
16
16
17
17
{% hint style="warning" %}
18
-
If you have any spaces in your file-path, please enclose it in quotation marks, otherwise amap will interpret it as two inputs, separated by a space.
18
+
If you have any spaces in your file-path, please enclose it in quotation marks, otherwise brainreg will interpret it as two inputs, separated by a space.
19
19
20
-
**i.e. `"/path/to/my data"` not `path/to/my data`.**
20
+
**i.e. `"/path/to/my data"` not `path/to/my data`.**
21
21
{% endhint %}
22
22
23
23
## Arguments
@@ -34,28 +34,50 @@ You must also specify the pixel sizes, see [Specifying pixel size](../../user-gu
34
34
### Additional options
35
35
36
36
*`-d` or `--downsample` Paths to N additional channels to downsample to the same coordinate space.
37
-
*`--no-save-downsampled` Don't save the downsampled brain before filtering.
38
-
*`--registration-config` To supply your own, custom registration configuration file
39
37
*`--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
40
38
41
39
#### Misc options
42
40
43
41
*`--n-free-cpus` The number of CPU cores on the machine to leave unused by the program to spare resources.
44
42
*`--debug` Debug mode. Will increase verbosity of logging and save all intermediate files for diagnosis of software issues.
45
43
44
+
### Atlas
45
+
46
+
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.:
47
+
48
+
```bash
49
+
--atlas allen_mouse_50um
50
+
```
51
+
52
+
{% hint style="info" %}
53
+
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.
54
+
{% endhint %}
55
+
56
+
### Registration backend
57
+
58
+
To change the registration algorithm used, use the `--backend` flag. The default is `niftyreg` as that is currently the only option.
59
+
46
60
### Input data orientation
47
61
48
-
If your data does not match the NifTI standard orientation \(origin is the most ventral, posterior, left voxel\), then please see [Image orientation](image-orientation.md)to reorient the atlas
62
+
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.
49
63
50
-
### Registration options
64
+
{% hint style="info" %}
65
+
When you work with a stack, the origin is the upper left corner when you show the first element `stack[0, :, :]` with matplotlib or when you open the stack with ImageJ. First dimension is the one that you are slicing, the second the height of the image, and the third the width of the image.
66
+
{% endhint %}
51
67
52
-
To change how the actual registration performs, see [Registration parameters](registration-parameters.md)
68
+
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:
53
69
54
-
### Visualisation options
70
+
```bash
71
+
--orientation psl
72
+
```
55
73
56
-
*`--no-boundaries` Do not precompute the outline images \(if you don't want to use `amap_vis`\)
74
+
{% hint style="warning" %}
75
+
The order of the three initials must be the same as the axis order \(sliced plane, height, width\)
76
+
{% endhint %}
77
+
78
+
### Registration options
79
+
80
+
To change how the actual registration performs, see [Registration parameters](registration-parameters.md)
57
81
58
-
## Visualisation
59
82
60
-
To visualise your data, please see [Visualisation](../../user-guide/visualisation.md)
Copy file name to clipboardExpand all lines: brainreg/getting-started/registration-parameters.md
+7-3
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,18 @@ description: How to refine the registration to the template image
4
4
5
5
# Registration parameters
6
6
7
-
To change how the image registration performs, you can change the options that are passed to [NiftyReg](http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftyReg):
7
+
To change how the image registration performs, you can change the options that are passed to the registration backend.
8
8
9
-
### **Affine registration**
9
+
## NiftyReg
10
+
11
+
If using the [NiftyReg](http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftyReg) backend, the following options can be changed:
12
+
13
+
#### **Affine registration**
10
14
11
15
*`--affine-n-steps` Registration starts with further downsampled versions of the original data to optimize the global fit of the result and prevent "getting stuck" in local minima of the similarity function. This parameter determines how many downsampling steps are being performed, with each step halving the data size along each dimension. **Default: 6**
12
16
*`--affine-use-n-steps` Determines how many of the downsampling steps defined by `-affine-n-steps` will have their registration computed. The combination `--affine-n-steps 3 --affine-use-n-steps 2` will e.g. calculate 3 downsampled steps, each of which is half the size of the previous one but only perform the registration on the 2 smallest resampling steps, skipping the full resolution data. Can be used to save time if running the full resolution doesn't result in noticeable improvements. **Default: 5**
13
17
14
-
### **Freeform registration**
18
+
####**Freeform registration**
15
19
16
20
*`--freeform-n-steps` Registration starts with further downsampled versions of the original data to optimize the global fit of the result and prevent "getting stuck" in local minima of the similarity function. This parameter determines how many downsampling steps are being performed, with each step halving the data size along each dimension. **Default: 6**
17
21
*`--freeform-use-n-steps` Determines how many of the downsampling steps defined by `--freeform-n-steps` will have their registration computed. The combination `--freeform-n-steps 3 --freeform-use-n-steps 2` will e.g. calculate 3 downsampled steps, each of which is half the size of the previous one but only perform the registration on the 2 smallest resampling steps, skipping the full resolution data. Can be used to save time if running the full resolution doesn't result in noticeable improvements. **Default: 4**
If you already have cellfinder, then amap has been installed for you.
9
-
{% endhint %}
10
-
11
7
## Introduction
12
8
13
-
amap is included with cellfinder. Unless you have a particular reason not to, I would install cellfinder as this will install all the packages you may need. See [cellfinder installation](../installation/installation.md).
14
-
15
9
If you know what you're doing just run:
16
10
17
11
```bash
18
-
pip install amap
12
+
pip install brainreg
19
13
```
20
14
21
15
{% hint style="info" %}
@@ -24,31 +18,31 @@ If you're not completely sure what you're doing, read on.
24
18
25
19
## Requirements
26
20
27
-
To run amap you will need a fairly high-powered computer running Windows or Linux \(see [system requirements](../installation/system-requirements.md) for details\). In particular, to use some of the atlases, you may need at least 32GB of RAM.
21
+
The hardware requirements for brainreg depend on the atlas \(and in particular the resolution\) you want to use. Most machines \(including laptops\) will be able to use most of the atlases, but some atlases \(such as the 10um mouse atlases\) may need up to 32GB of RAM.
22
+
23
+
Currently brainreg works on Windows and Linux. macOS support is experimental.
28
24
29
25
## Setting up your machine
30
26
31
27
### Installing Python
32
28
33
-
amap is written in Python, and so needs a functional Python installation. Your machine may already have Python installed, but **I recommend installing miniconda**.
29
+
brainreg is written in Python, and so needs a functional Python installation. Your machine may already have Python installed, but **I recommend installing miniconda**.
amap should run on any type of Python installation, but if you don't use conda, I may not be able to help you.
34
+
brainreg should run on any type of Python installation, but if you don't use conda, I may not be able to help you.
39
35
{% endhint %}
40
36
41
-
## Installing amap
37
+
## Installing brainreg
42
38
43
39
{% hint style="info" %}
44
40
Remember to activate your conda environment before doing anything
45
41
{% endhint %}
46
42
47
43
```bash
48
-
pip install amap
44
+
pip install brainreg
49
45
```
50
46
51
-
## Download atlas and trained classification models \(optional\)
52
47
53
-
When you run amap, it will download the files it needs \(e.g. the atlas\). If you want to save time later, or you know you won't have an internet connection when you run amap you can download these in advance. See [downloading files](downloading-files.md) for details.
amap is included with cellfinder, and exists as a standalone tool if you do not need the cell detection part
5
-
{% endhint %}
6
-
7
3
## About
8
4
9
-
amap is the part of cellfinder that takes care of image registration and atlas-based segmentation. It is a Python port of [aMAP](https://github.com/SainsburyWellcomeCentre/aMAP/wiki)\(originally written in Java\), which has been [validated against human segmentation](https://www.nature.com/articles/ncomms11879).
5
+
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).
10
6
11
-
The actual registration is carried out by[NiftyReg](http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftyReg).
7
+
Currently the only registration backend is[NiftyReg](http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftyReg).
12
8
13
9
## Details
14
10
15
-
The aim of amap 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.
11
+
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.
16
12
17
13
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.
18
14
19
-
Full details of the process are in the [original paper](https://www.nature.com/articles/ncomms11879).
15
+
Full details of the process are in the [original paper](https://www.nature.com/articles/ncomms11879).
20
16
21
17

22
18
23
19
## Installation
24
20
25
21
```bash
26
-
pip install amap
22
+
pip install brainreg
27
23
```
28
24
29
25
{% hint style="info" %}
@@ -33,14 +29,10 @@ For detailed instructions see [Installation](installation.md)
0 commit comments