Segmentation of cells with nuclei and membrane signals

Hi All,

cc @iarganda @Alex_H @k-dominik @oburri @simonfn @tinevez

We would like to segment the cells in such 3D images:

Raw data: embryo1.zip (9.6 MB)

And we were wondering which tools to explore.

To my mind came:

  1. Probably ilastik? But I was not sure which workflow to chose for nuclei as seeds and then membranes as boundaries.
  2. I was also thinking about ImageJ/Morpholibj: https://imagej.net/Marker-controlled_Watershed
  3. ImageJ’s 3-D Image Suite also appears to have a 3D Watershed with seeds
  4. Imaris Cell

Do you think those make sense and/ or are we missing something obvious?

Thank you very much for your input!

LimeSeg (by @NicoKiaru) might be another option to explore:

3 Likes

Cellpose works in 3D as well, and has a built in model you could try. Installation is a bit convoluted (sic) if you’re not familiar with python, anaconda, CUDA and MKL, but it’s worth a try.

4 Likes

Hi @Tischi,

this looks like very good data for ilastik. In particular for the Multicut Workflow. The only challenging task is probably getting the boundary predictions right. But they look sort of decent already. In any case You can try Pixel Classification, or Autocontext if this is not good enough to produce nice boundaries. Furthermore, there are those pre-trained networks for the plantseg that also seem to work very nicely on these kinds of boundary images.

3 Likes

I will contact a user we had at the facility who did these kinds of analyses on time lapse data.

For them, the most essential step was to get as little noise as possible. We had trained a N2V model for that and they were super happy. The segmentation was in Matlab I think from a toolkit specific for this kind of tight cell segmentation. More info after they get back to me.

1 Like

Thanks! Can I use the segmented nuclei as seeds? Or does the Multicut Workflow work without seeds? The final aim is to have label mask images with the cells and the nuclei having the same label index.

1 Like

Thanks! Did you try it yourself already? I glanced over the documentation and it seemd like you have to manually provide the “spherical” seeds points (rather than using the segmented nuclei as a seed points)?!

1 Like

You could also try the Morphological Segmentation :wink:

2 Likes

Multicut works without seeds, but assigning nuclei labels from cell labels will be something we can definitely do :slight_smile:

1 Like

But that just takes one channel, right? I think for this data really something that uses the nuclei as seeds should be the best, shouldn’t it?

Morphological Segmentation

This works quite nice, however we need to over-segment and then manually merge some labels. This would be too tedious for a lot of data. Maybe we could preprocess the membrane channel with the Trainable 3D Weka Segmentation, what do you think? @iarganda

image

Marker controlled watershed

Also this is promising, however, as there are no nuclei outside the embryo, the dams that point to the outside (marked below) are ignored. @iarganda How would you deal with this? Would one manually have to add seed points outside the embryo? I think @Alex_H sometimes uses the trick to make all boundary pixels of an image become one giant seed…

image

1 Like

Hello, I tried my segmentation model on the image which was trained on a similar but not exactly the same type of data as yours. With training on your own data this would get better, however the downside is that the tool is totally python. Uploading the segmentation I get using slice by slice approach. I had to upsample (by 2) the image to suit my model though.



My tif is > 35 mb so not uploading but you can take a look here:

4 Likes

Would you be willing to share how you did it? I.e. a script or Jupyter notebook showing what you did to get this nice visualization?

Is your trained model available publicly?

2 Likes

Continuing the discussion from Segmentation of cells with nuclei and membrane signals:

After all these lovely open-source suggestions:
I would try in Imaris first, because it is 3D and I am lazy :wink:

https://imaris.oxinst.com/learning/view/article/segment-analyze-images-of-cells-characterized-by-their-distinct-membrane-staining

5 Likes

Hi jan,

Yeah thats the thing. I use a combination of Care based denoising followed by unet+ stardist to do marker controlled watershed with something i call smartcorrection. However i havent written the paper yet which i hope to get out by year end with zero cost notebook for public.

However till then am open to collaborations where i give you the segmentations and napari based correction tool for 3d + time images and i get co-authorship. Sounds good?

1 Like

Thanks, I am convinced that a model where you develop in the open, get feedback from the community, and then write up a paper (and publish it as preprint) will produce better results in the long term and has more impact (in terms of usage in the community) – and even give higher impact papers, if you want to trust this measure.

3 Likes

It just takes time to get to the stage where i would like to have a user feedback because currently am benchmarking it for 2D/3D n membrane/cytoplasm/ nuclei also dic against existing methods that are close to one click segmentations. After benchmarking i want to send it to some people, the tool + draft. If you are intersted in testing it i am of course happy to send it to you as well but until i am there, and people want to see the results with my trained model they can be my collaborators or else give me some time to reach the planned milestones after which the tool goes from semi open to fully open.

Also because several teams at curie are involved in this n there is always their considerations that have to be weighed in before releasing tools openly. Because they want to publish first and do not want data or models trained on their data to be released but in the interest of science i am allowed to have external collaborations.

4 Likes

Thank you for the suggestion.
We tried Imaris Cell and it works in fact quite well on this kind of data.
The other upside of using Imaris is that one can also track the detected cells in Imaris, which is in fact something that we also need for this project.

2 Likes

Hi Christian,

I’m glad that you found something useful. FYI LimeSeg works also well for these kind of data. As you mentioned in LimeSeg you need to provide the seeds, but that doesn’t mean manual. Since you have the nuclei channel, it’s actually pretty easy to find the seeds.

I’ve made a demo script with your data if you would like to try (this can be optimized). LimeSeg can also be used it to follow the shape of cells over time. It becomes more tricky if you have cell division.

Screenshot with your data:

And the script to reproduce this:

waitForUser("LimeSeg and 3D image suite update sites needs to be enabled!");
run("Show GUI"); // Initializes LimeSeg
run("Clear all"); // Clear previous LimeSeg outputs
run("Close All");
roiManager("reset");
// https://forum.image.sc/t/segmentation-of-cells-with-nuclei-and-membrane-signals/41134
// https://forum.image.sc/uploads/short-url/i7gqfTsp8AXuC6vXfo15sFMHomd.zip

waitForUser("Fetch example image from ImageSc Forum");
open("https://forum.image.sc/uploads/short-url/i7gqfTsp8AXuC6vXfo15sFMHomd.zip");
// Stores Image ID
idImage=getImageID();


// Looks for seeds:
waitForUser("Looks for seeds");
run("Duplicate...", "duplicate channels=1");
run("Gaussian Blur 3D...", "x=10 y=10 z=4");
run("Clear Results");
run("3D Maxima Finder", "minimmum=3000 radiusxy=3 radiusz=3 noise=100");

// Radius of the initial seed for LimeSeg
radius=20;

// Stores results into ROI Manager
waitForUser("Store results into ROI Manager");

for (i=0;i<nResults;i++) {
	xp=getResult("X", i);	
	yp=getResult("Y", i);	
	zp=getResult("Z", i);
	//setSlice(zp+1);	
	makeOval(xp-radius,yp-radius,2*radius,2*radius);
	Roi.setPosition(1, zp+1, 1);
	roiManager("Add");
}

close();
close();

// Prepare to work on the initial CElegans image
selectImage(idImage);

// Channel 2
setSlice(2);

run("Sphere Seg", "d_0=4 f_pressure=0.015 z_scale=4.7 range_in_d0_units=1.5 samecell=false show3d=true numberofintegrationstep=-1 realxypixelsize=0.322");

9 Likes

Hey @NicoKiaru,

wow, that looks super awesome! I think I’d like to try that on my data (which is very similar but has many time points).

Can you provide a link / tutorial on how good parameters for Sphere Seg are determined?

run("Sphere Seg", "d_0=4 f_pressure=0.015 z_scale=4.7 range_in_d0_units=1.5 samecell=false show3d=true numberofintegrationstep=-1 realxypixelsize=0.322");

I found this video tutorial where you do it but it’s unfortunately without sound :slight_smile:

Thanks!

Cheers,
Robert

2 Likes