• Stars
    star
    179
  • Rank 214,039 (Top 5 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created almost 5 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Automated 3D cell detection in very large images

Python Version PyPI Downloads Wheel Development Status Tests codecov Code style: black Imports: isort pre-commit Contributions Website Twitter

Cellfinder

Whole-brain cell detection, registration and analysis.

N.B. If you want to just use the cell detection part of cellfinder, please see the standalone cellfinder-core package, or the cellfinder plugin for napari.


cellfinder is a collection of tools developed by Adam Tyson, Charly Rousseau and Christian Niedworok in the Margrie Lab, generously supported by the Sainsbury Wellcome Centre.

cellfinder is a designed for the analysis of whole-brain imaging data such as serial-section imaging and lightsheet imaging in cleared tissue. The aim is to provide a single solution for:

  • Cell detection (initial cell candidate detection and refinement using deep learning) (using cellfinder-core)
  • Atlas registration (using brainreg)
  • Analysis of cell positions in a common space

Installation is with pip install cellfinder


Basic usage:

cellfinder -s signal_images -b background_images -o output_dir --metadata metadata

Full documentation can be found here.

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 or by raising an issue.


Illustration

Introduction

cellfinder takes a stitched, but otherwise raw whole-brain dataset with at least two channels:

  • Background channel (i.e. autofluorescence)
  • Signal channel, the one with the cells to be detected:

raw Raw coronal serial two-photon mouse brain image showing labelled cells

Cell candidate detection

Classical image analysis (e.g. filters, thresholding) is used to find cell-like objects (with false positives):

raw Candidate cells (including many artefacts)

Cell candidate classification

A deep-learning network (ResNet) is used to classify cell candidates as true cells or artefacts:

raw Cassified cell candidates. Yellow - cells, Blue - artefacts

Registration and segmentation (brainreg)

Using brainreg, cellfinder aligns a template brain and atlas annotations (e.g. the Allen Reference Atlas, ARA) to the sample allowing detected cells to be assigned a brain region.

This transformation can be inverted, allowing detected cells to be transformed to a standard anatomical space.

raw ARA overlaid on sample image

Analysis of cell positions in a common anatomical space

Registration to a template allows for powerful group-level analysis of cellular disributions. (Example to come)

Examples

(more to come)

Tracing of inputs to retrosplenial cortex (RSP)

Input cell somas detected by cellfinder, aligned to the Allen Reference Atlas, and visualised in brainrender along with RSP.

brainrender

Data courtesy of Sepiedeh Keshavarzi and Chryssanthi Tsitoura. Details here

Visualisation

cellfinder comes with a plugin (brainglobe-napari-io) for napari to view your data

Usage

  • Open napari (however you normally do it, but typically just type napari into your terminal, or click on your desktop icon)

Load cellfinder XML file

  • Load your raw data (drag and drop the data directories into napari, one at a time)
  • Drag and drop your cellfinder XML file (e.g. cell_classification.xml) into napari.

Load cellfinder directory

  • Load your raw data (drag and drop the data directories into napari, one at a time)
  • Drag and drop your cellfinder output directory into napari.

The plugin will then load your detected cells (in yellow) and the rejected cell candidates (in blue). If you carried out registration, then these results will be overlaid (similarly to the loading brainreg data, but transformed to the coordinate space of your raw data).

load_data Loading raw data

load_data Loading cellfinder results

Contributing

Contributions to cellfinder are more than welcome. Please see the developers guide.

Citing cellfinder

If you find cellfinder useful, and use it in your research, please cite the paper outlining the cell detection algorithm:

Tyson, A. L., Rousseau, C. V., Niedworok, C. J., Keshavarzi, S., Tsitoura, C., Cossell, L., Strom, M. and Margrie, T. W. (2021) โ€œA deep learning algorithm for 3D cell detection in whole mouse brain image datasetsโ€™ PLOS Computational Biology, 17(5), e1009074 https://doi.org/10.1371/journal.pcbi.1009074

If you use any of the image registration functions in cellfinder, please also cite brainreg.

If you use this, or any other tools in the brainglobe suite, please let us know, and we'd be happy to promote your paper/talk etc.

More Repositories

1

brainrender

a python based software for visualization of neuroanatomical and morphological data.
Python
540
star
2

brainglobe-atlasapi

A lightweight python module to interact with atlases for systems neuroscience
Python
125
star
3

brainreg

Automated 3D brain registration with support for multiple species and atlases.
Python
121
star
4

slicereg

A 2D-3D histological brain slice registration application for mouse, rat, zebrafish brains.
Python
37
star
5

brainglobe-heatmap

Rendering anatomical heatmaps with brainrender and matplotlib
Python
34
star
6

brainglobe-segmentation

Segmentation of anatomical structures in a common coordinate space
Python
28
star
7

cellfinder-napari

Efficient cell detection in large images using cellfinder in napari
Python
24
star
8

cellfinder-core

Standalone cellfinder cell detection algorithm
Python
19
star
9

brainrender-napari

A napari plugin to render BrainGlobe atlases and associated data as layers.
Python
19
star
10

morphapi

A lightweight python package to download neuronal morphologies
Python
17
star
11

brainreg-napari

Automated 3D brain registration in napari with support for multiple species and atlases.
Python
14
star
12

brainglobe-napari-io

Read and write files from the BrainGlobe neuroanatomy suite
Python
13
star
13

brainglobe-registration

Registration to BrainGlobe atlases in napari using Elastix
Python
13
star
14

bg-brainrender-gui

A GUI built on brainrender: visualise brain regions, neurons and labelled cells.
Python
12
star
15

bg-atlasgen

Tools for packaging atlases for use with BrainGlobe
Python
12
star
16

brainglobe-utils

Shared general purpose tools for the BrainGlobe project
Python
11
star
17

brainrender_paper

Code for recreating the figures in the brainrender paper (Claudi et al. 2020)
Python
11
star
18

probeplanner

Helps plan where to put things in brains
Python
10
star
19

BrainGlobe

General information, resources and dicussions for the BrainGlobe project.
10
star
20

brainglobe-meta

(Meta-)package repository for BrainGlobe's Python tools for computational neuroanatomy.
Python
10
star
21

brainglobe.github.io

brainglobe.info website
Python
10
star
22

imio

Loading and saving of image data.
Python
10
star
23

napari-brainreg

Visualise brainreg registration output
Python
10
star
24

cellfinder-visualize

Python
9
star
25

bgviewer

Visualisation and exploration of brain atlases
Python
9
star
26

brainrender-docs

CSS
9
star
27

brainglobe-workflows

Workflows that utilise BrainGlobe tools to perform data analysis and visualisation.
Python
9
star
28

brainglobe-template-builder

Build unbiased anatomical templates from individual images
Python
8
star
29

napari-cellfinder

Python
8
star
30

brainglobe-space

Anatomical space conventions made easy.
Python
8
star
31

bg-gitbook

Mirror of the brainglobe GitBook page
7
star
32

napari-brainreg-standard

Visualise brainreg registration output in standard space
Python
7
star
33

actions

Re-usable GitHub Action scripts
6
star
34

brainglobe-web

brainglobe.info website
HTML
6
star
35

brainglobe-stitch

A napari plugin for stitching large tiled 3D imaging datasets
Python
6
star
36

.github

Common templates for BrainGlobe repositories.
6
star
37

course-dec-2023

Materials for the BrainGlobe & napari course at the Sainsbury Wellcome Centre
JavaScript
6
star
38

slides-roadmap-oct-2023

SCSS
4
star
39

napari-experimental

Python
2
star
40

micrometa

Parsing of whole-brain microscopy metadata
Python
1
star