Skip to content

3D segmentation of nuclei (fixed) and cells (live) of the developing mouse embryo

Notifications You must be signed in to change notification settings

kreshuklab/mouse-embryo-seg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mouse-embryo-seg

3D segmentation of nuclei (fixed) and cells (live) of the developing mouse embryo

Prerequisites

  • Linux
  • modern NVIDIA GPU with 10+ GB of memory (e.g. Nvidia 2080Ti)
  • CUDA

Installation

  1. Create conda environment with the required dependencies:
conda env create -f 
  1. Activate conda environment:
conda activate embryo-seg
  1. Checkout the repository:
git clone https://github.com/kreshuklab/mouse-embryo-seg.git
  1. Add the repository directory to the PYTHONPATH environment variable (assumes that the repo was cloned to ~/mouse-embryo-seg)
export PYTHONPATH="~/mouse-embryo-seg:$PYTHONPATH"

Segmentation of fixed images of nuclei (confocal)

The pipeline for nuclei segmentation of the nuclei consists of 2-steps:

  1. semantic segmentation with a 3D U-Net, where the target task is predicting the nuclei mask (1st channel) together with the nuclei outlines (2nd channel)
  2. instance segmentation with one of the following strategies:
    • using the 2nd channel (nuclei boundaries) + plantseg segmentation
    • thresholding on the 1st channel (nuclei mask) + connected components (baseline)

PlantSeg's nuclei segmentation (1)

  1. Download the 3D UNet model files, trained to predict the nuclei (foreground + outlines) from here
  2. Add model to PlantSeg: Create directory ~/.plantseg_models/confocal_unet_mouse_embryo_nuclei and copy the downloaded files (config_train.yml, last_checkpoint.pytorch, best_checkpoint.pytorch) into it.
  3. Update path attribute in the plantseg's YAML config to point to the directory containing the nuclei stained images
  4. Predict nuclei masks and outlines with PlantSeg:
plantseg --config configs/plantseg_nuclei/plantseg_pmaps.yaml
  1. Assuming the nuclei stained images were in ~/embryo_nuclei directory, extract the 2nd channel from the predictions using the script:
python extract_channel.py --channel 1 --input-dir ~/embryo_nuclei --output-dir ~/nuclei_boundaries
  1. Update path attribute in the YAML config to point to the directory containing the predicted boundaries and segment the nuclei using PlantSeg:
plantseg --config configs/plantseg_nuclei/plantseg_seg.yaml

The segmentation results will be saved with the hdf5 format inside the ~/nuclei_boundaries directory. By default GASP agglomeration strategy with MutexWatershed linkage criteria will be used. See A. Bailoni et al. for more info.

Connected components baseline

In order to compare the above results with the connected components baseline: Execute the steps 1-3 from above and then (assuming the network predictions were saved in ~/nuclei_predictions) execute:

python threshold_segmentation.py --pmaps ~/nuclei_predictions

The segmentation results will be saved in the network prediction hdf5 files as a separate dataset called cc_segmentation.

Segmentation of live membrane stained images (light-sheet)

  1. Download the 3D UNet model files, trained to predict the membranes from here
  2. Add model to PlantSeg: Create directory ~/.plantseg_models/lightsheet_unet_mouse_embryo_membranes and copy the downloaded files (config_train.yml, last_checkpoint.pytorch, best_checkpoint.pytorch) into it.
  3. Update path attribute in the plantseg's YAML config to point to the directory containing the membrane stained images
  4. Segment the nuclei using PlantSeg:
plantseg --config configs/plantseg_membranes/plantseg_config.yaml

The segmentation results will be saved with the hdf5 format inside the image directory.

Network training

UNet models were trained with the pytorch-3dunet package. The data used for training can be donwloaded here.

Cite

@article{https://doi.org/10.15252/embj.2022113280,
author = {Bondarenko, Vladyslav and Nikolaev, Mikhail and Kromm, Dimitri and Belousov, Roman and Wolny, Adrian and Blotenburg, Marloes and Zeller, Peter and Rezakhani, Saba and Hugger, Johannes and Uhlmann, Virginie and Hufnagel, Lars and Kreshuk, Anna and Ellenberg, Jan and van Oudenaarden, Alexander and Erzberger, Anna and Lutolf, Matthias P and Hiiragi, Takashi},
title = {Embryo‐uterine interaction coordinates mouse embryogenesis during implantation},
journal = {The EMBO Journal},
volume = {42},
number = {17},
pages = {e113280},
keywords = {biophysical modeling, embryo, engineering, Implantation, uterus},
doi = {https://doi.org/10.15252/embj.2022113280},
url = {https://www.embopress.org/doi/abs/10.15252/embj.2022113280},
eprint = {https://www.embopress.org/doi/pdf/10.15252/embj.2022113280},
year = {2023}
}

About

3D segmentation of nuclei (fixed) and cells (live) of the developing mouse embryo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published