Skip to content

Commit 65a4f9a

Browse files
adamltysongitbook-bot
authored andcommitted
GitBook: [master] one page modified
1 parent a1bbceb commit 65a4f9a

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

tutorial/tutorial.md

+39-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Although cellfinder is designed to be easy to install and use, if you're coming
2222
* Download the data from [here](https://gin.g-node.org/cellfinder/data/raw/master/brainreg/test_brain.zip) \(it will take a long time to download\).
2323
* Unzip the data to a directory of your choice \(doesn't matter where\). You should end up with a directory called `test_brain` with two directories, each containing 2800 images.
2424
* Open a terminal \(Linux\) or your command prompt \(Windows\)
25+
* Navigate to the directory containing the `test_brain` directory \(e.g. using `cd`\)
2526
* Activate your [conda environment ](../installation/using-conda.md)
2627

2728
{% hint style="info" %}
@@ -30,15 +31,52 @@ The test data supplied is purposefully not the "best". It has some artefacts suc
3031
The aim of this tutorial is not to show cellfinder performing perfectly, but to illustrate how it deals with less than perfect data, and how to improve the performance.
3132
{% endhint %}
3233

33-
#### Run cellfinder
34+
#### Before you start
3435

3536
To run cellfinder, you need to know:
3637

3738
* Where your data is \(in this case, it's the path to the `test_brain` directory\)
39+
* Which image is the primary signal channel \(the one with the labelled cells\) and which is the secondary autofluorescence channel. In this case, `test_brain/ch00` is the signal channel and `test_brain/ch01` is the autofluroescence channel
3840
* Where you want to save the output data \(we'll just save it into a directory called `cellfinder_output`in the same directory as the `test_brain`\)
3941
* The pixel sizes of your data in microns \(see [Specifying pixel size](../user-guide/usage/specifying-pixel-size.md) for details\). In this case, our data is 2um per pixel in x and y \(in the coronal plane\) and 5um in z \(the spacing of each plane\).
4042
* The orientation of your data. For atlas registration \(using [brainreg](https://docs.brainglobe.info/brainreg/introduction)\) the software needs to know how you acquired your data \(coronal, saggital etc.\). For this cellfinder uses [bg-space](https://github.com/brainglobe/bg-space). Full details on how to enter your data orientation can be found [here](https://docs.brainglobe.info/brainreg/user-guide#input-data-orientation), but for this tutorial, the orientation is `psl`, which means that the data origin is the most **p**osterior, **s**uperior, **l**eft voxel.
4143
* Which atlas you want to use \(you can see which are available by running `brainglobe list`. In this case, we want to use a mouse atlas \(as that's what our data is\), and we'll use the 10um version of the [Allen Mouse Brain Atlas](https://mouse.brain-map.org/static/atlas).
4244

45+
#### Running cellfinder
4346

47+
cellfinder runs with a single command, with various arguments that are detailed in [Command line options](../user-guide/usage/). To analyse the example data, the flags we need are:
48+
49+
* `-s` The primary **s**ignal channel: `test_brain/ch00`
50+
* `-b` The secondary autofluorescence channel \(or **b**ackground\): `test_brain/ch01`
51+
* `-o` The **o**utput directory : `test_brain/output`
52+
* `-x` The pixel spacing in the first dimension \(left to right on a single plane in an image\): `2`
53+
* `-y` The pixel spacing in the second dimension \(top to bottom on a single plane in an image\): `2`
54+
* `-z` The pixel spacing in the third dimension \(the plane spacing\): 5
55+
* `--orientation` The data orientation: `psl`
56+
* `--atlas` The atlas we want to use: `allen_mouse_10um`
57+
58+
Putting this all together into a single command gives:
59+
60+
```text
61+
cellfinder -s test_brain/ch00 -b test_brain/ch01 -o test_brain/output -x 2 -y 2 -z 5 --orientation psl --atlas allen_mouse_10um
62+
```
63+
64+
This command will take quite a long time \(anywhere from 2-10 hours\) to run, depending on:
65+
66+
* The speed of the disk the data is stored on
67+
* The CPU speed and number of cores
68+
* The GPU you have
69+
70+
If you just want to check that everything is working, we can speed everything up by:
71+
72+
* Only analysing part of the brain using the flags: `--start-plane 1500 --end-plane 1550`
73+
* Using a lower-resolution atlas, using the flag: `--atlas allen_mouse_25um`
74+
75+
```text
76+
cellfinder -s test_brain/ch00 -b test_brain/ch01 -o test_brain/output -x 2 -y 2 -z 5 --orientation psl --atlas allen_mouse_25um --start-plane 1500 --end-plane 1550
77+
```
78+
79+
{% hint style="warning" %}
80+
If your machine has less than 32GB of RAM, you should use the `allen_mouse_25um` atlas either way, as registration with the high-resolution atlas requires about 30GB for this image.
81+
{% endhint %}
4482

0 commit comments

Comments
 (0)