Although cellfinder is designed to be easy to install and use, if you're coming to it with fresh eyes, it's not always clear where to start. We provide an example brain to get you started, and also to illustrate how to play with the parameters to better suit your data.
First install cellfinder, following the Installation guide.
Download the data from here (it will take a long time to download).
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.
Open a terminal (Linux) or your command prompt (Windows)
Navigate to the directory containing the
test_brain directory (e.g. using
Activate your conda environment
To run cellfinder, you need to know:
Where your data is (in this case, it's the path to the
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
Where you want to save the output data (we'll just save it into a directory called
cellfinder_outputin the same directory as the
The pixel sizes of your data in microns (see Specifying pixel size 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).
The orientation of your data. For atlas registration (using brainreg) the software needs to know how you acquired your data (coronal, saggital etc.). For this cellfinder uses bg-space. Full details on how to enter your data orientation can be found here, but for this tutorial, the orientation is
psl, which means that the data origin is the most posterior, superior, left voxel.
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.
cellfinder runs with a single command, with various arguments that are detailed in Command line options. To analyse the example data, the flags we need are:
-s The primary signal channel:
-b The secondary autofluorescence channel (or background):
-o The output directory :
-x The pixel spacing in the first dimension (left to right on a single plane in an image):
-y The pixel spacing in the second dimension (top to bottom on a single plane in an image):
-z The pixel spacing in the third dimension (the plane spacing): 5
--orientation The data orientation:
--atlas The atlas we want to use:
Putting this all together into a single command gives:
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
This command will take quite a long time (anywhere from 2-10 hours) to run, depending on:
The speed of the disk the data is stored on
The CPU speed and number of cores
The GPU you have
If you just want to check that everything is working, we can speed everything up by:
Only analysing part of the brain using the flags:
--start-plane 1500 --end-plane 1550
Using a lower-resolution atlas, using the flag:
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
cellfinder runs many different steps, and saves many files for downstream analysis. By default (many of these parts can be disabled with command-line flags) the following steps will be run:
cellfinder comes with a plugin for napari for easily visualising the results. To open napari, just run
napari from your command line, and a viewer window should pop up.
Into the window, then drag and drop:
The signal channel directory (
The entire cellfinder output directory