Pipeline to detect individual nuclei in crowded immunofluorescence images. Effective in 2D embryo sections and single-z plane images. Additionally, a range of tools are available for estimating 3D nuclei in whole-embryo, organoid, or embryo model confocal microscopy stacks.
Please find installation notes below. To detect nuclei in your own image of interest I recommend you first following one of the two example notebooks.
2D notebook example: Nucleus_Predict_2D. Example images here and here.
3D notebook example: Nucleus_Predict_3D.
Please note, we mostly tested:
- DAPI nuclear stains
- Resolutions of 3.5 to 6 pixels/μm (typically with 40-60X objectives on a Leica SP8/ Zeiss LSM710)
- The size of the images should be a multiple of 128, e.g. 1024x2084. There is a check in the pipeline for this.
Ideally, a 256x256 pixels crop of your images should look similar to the images the network was trained on. See below some examples.
This table shows the main datasets used to train and validate our models. These are available here.
#images | #instances | size | comments | |
---|---|---|---|---|
nucleus_train | 6 | 221 | 256*256 | in vitro hESC assay |
nucleus_val (validation) | 4 | 141 | 256*256 | in vitro hESC assay |
kromp_ 2019 | 52 | 1,704 | 640*512 | curated from Kromp et al. (2019) |
segm_512 | 3 | 566 | 512*512 | in vitro hESC assay |
SC_human | 4 | X | 256*256 | Spinal Cord sections |
SC_mouse | 6 | X | 256*256 | Spinal Cord sections |
SC_sections (validation) | 5 | X | 256*256 | Spinal Cord sections |
Distribution of the maximum length of the nuclei in the different datasets.
Make sure you have access to GPU. Anaconda and foss installed. This package originally used python 3.7.
Download PyTorch models for Nucleus at https://zenodo.org/records/11388472/files/Nucleus_models.gz?download=1
git clone https://github.com/tiagu/Nucleus
conda env create --name nucleus --file=./Nucleus/environment.yml
conda activate nucleus
python -m pip install detectron2==0.4 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.8/index.html
pip install --no-cache-dir git+https://github.com/tiagu/Nucleus
For slurm users, please see run_nucleus.sh on utils folder.