MorphoNet

Tutorial 2: Interactive 4D segmentation with MorphoNet

This tutorial shows, step by step, how to employ Python and MorphoNet to segment and track 3D cells. It guides users from raw data to final results.

Requirements

For this tutorial, you need python 3.x and the API of morphonet. You can easly install it using pip install morphonet

The API has some dependecies scipy , numpy, scikit-image, vtk

Part 1 : Data Preparation

Three dimentional data of live embryonic development at single-cell resolution were taken through light-sheet microscopy and segmented using the automatic segmentation pipeline ASTEC, as explained in Guignard L, Fiúza UM, Leggio B, Laussu J, Faure E, Michelin G, Biasuz K, Hufnagel L, Malandain G, Godin C, Lemaire P. Contact area-dependent cell communication and the morphological invariance of ascidian embryogenesis. Science. 2020 Jul 10; 369(6500):eaar5663.

In this tutorial we take as example the data corresponding to the embryo referred to as PM2 in the paper.

Data for this embryo can be found at:https://figshare.com/s/765d4361d1b073beedd5. You can just download fused files ('Astec-pm2_fuse.tar.gz')

Theses files contains 95 time steps but here we will only keep work on the first 10 time steps.

1.1 Dataset specification

We begin with intensity images to be segmented, what we call here raw data. To import them in Python we use the library imread function in morphonet.tools. Each raw image corresponds to the intensity of fluorescence captured by the microscope, after a process of fusion of data collected at different angles. Two consecutive images are separated by a timegap of two minutes.

In [1]:
fused_files="Astec-pm2/FUSE/FUSE_RELEASE/Astec-Pm2_fuse_t{:03d}.inr"   #Fused images filename
begin=1 #first timepoint of dataset
end=10 #last timepoint of dataset

output_files="Astec-pm2/MySegmentation/Astec-Pm2_seg_t{:03d}.inr" # the segmentation files that we will generate

1.2 Launch the curation

We first just import the MorphoNet API. We don't specially need to be connected to morphonet because the curated mode do not need to upload data on the MorphoNet server. We create the plot as a new web page in the browser, and fill the dataset parameters.

Now we can start the curation mode using all plugins include in MorphoNet.

In [ ]:
import morphonet
mc=morphonet.Plot() #Connect to the MorphoNet Curation
mc.setDataset(begin=begin,end=end,raw=fused_files,segment=output_files) #Specify the variables corresponding to your dataset
mc.curate() # Launch the curation

It should directly open your firefox browser and plot the dataset. Now you don't need to use python anymore , you can just curate your data on the browser

Part 2 : Morpho Plot

He we show use how to use couple of MorphoPlugins. During the curation process each step is save in the output_folder.

2.1 Plugin : ExtremeWater

This plugin allow you to perform a complete 3D segmentation process of raw images. This plugin first apply a gaussian on the raw images. Then find the local minima (or maximal) We create a mask using a simple threshold method to avoid any detection in the background. And finally perform a watershed segmentation on this labeled peaks.

The output of this algorithm is directly saved as a segmented image into the segment folder. Finally each segmented image is transformed into an .obj containing the surface mesh and the objects identities, following the standard MorphoNet format, and directly send to the browser

One common problem during segmentations is the so-called undersegmentation, consisting in two or more cells detected as one. MorphoNet can easily help identifying and solving this class of problems: pick all undersegmented cells, apply a color selection to them and save it with the name "split", as shown in the video below.

2.2 Plugin : delete

One common problem during segmentations is due to the noise in the background where false objects are detected . In this case objects appear in MorphoNet and we can just select them and aplly the delete plugin. You can of course select more than one each time.

2.3 Plugin : fuse

Another common problem during segmentations is the so-called oversegmentation, consisting one cell detected as many. MorphoNet can easily help identifying and solving also this class of problems: as done for the undersegmentation case, pick all cells to merge together and apply a specific color code to them. Use a different color code for each group of cells to merge together. Finally just click on the "fuse" plugin.

2.5 Plugin : Create Seeds

In this example, we miss some cells. So we would like to create them. For that we will apply a classical watershed) algorithm based on seeds. We first addd manually some seeds on the X plan of the rawdata. And then simply execute the watershed plugins. Don't forget we working with 3D images, this process takes times..

Now we will simply manually create the cell lineage tree by clicking on each cell and their corresponding daughters