Cell profiler find secondary objects

Hey all,
I’m using cell profiler to find cells and vacuoles in cmac and gfp images. I can find the vacuole pretty well in cellprofiler, but when it comes to finding the cell, it does not work very well. Currently, what I am doing is the follows:

  1. Find primary objects for the vacuole, using adaptive threshold and using intensity to differentiation the vacuoles
  2. Using the vacuoles to try to find the cells using find secondary objects, this is the part that does not work very well
    So the main problem is using find secondary objects to find cells that the vacuoles are inside

gfp image(grayscale):
cell.tif (8.0 MB)

vacuole image(grayscale):
vacuole.tif (8.0 MB)

current pipeline:
yeastcellPM.cpproj (675.3 KB)

So the classic use of IdentifyPrimaryObjects and IdentifySecondaryObjects is to detect nuclei (primary objects) and then use them as seeds to spread out to the edge of the cells (secondary objects). I.e. the secondary objects are larger. Additionally, this always results in a 1:1 ratio for primary and secondary objects. Your vacuole image shows larger objects than your cells thus it would make more sense for your cells to be primary and spread out to your vacuoles.

HOWEVER, I also see what I think is some vacuoles with multiple cells inside and some with none which causes a problem for the 1:1 ratio. Therefore, it may be better to use two IdentifyPrimaryObjects modules for both cells and vacuoles and then use RelateObjects to relate them to each other.

Does this make sense?



I have tried to use identfy primary object to find cells but it comes out all blobby, any tips for settings?

Hi mdI54

I have created a pipeline for you that should get you close to what you want.
Firstly I enhanced all circles in your cell.tiff to remove some of the intensity issues.

Then I did a gaussian smoothing and OTSU filtering to identify your cells

Then an OTSU to identify your vacuoles

As you can see this still need refinement

But you can then use relate objects, rather than find secondary objects, because you have vacuoles that have no cell bodies and vacuoles that are larger than the cell bodies.

Depending on your question, you may want to look into expanding the cell bodies to encompass the vacuoles, illumination correction to remove some of the image bleeding.

I hope this helps
Cellprofiler yeastcellPM.cpproj (857.7 KB)


1 Like

Thanks! very helpful

So some of the outlines line up very well, some do not, is there any way to filter out the ones that do not line up very well?

Hi mdl54

I am a little unclear as what you mean. But you will need optimize the identifyprimaryobjects for both to get a more accurate outline for the cells and vacuoles. I would check out smoothkeepingedges, enhancespeckles, and the segmentation choices. If you are talking about removing vacuoles that are not in cells, I would look at relateobjects or identifytertiaryobjects. There are also measurements that you can take of each object and use filterobjects to remove particular objects.


To clarify, some of the cell outline are not very accurate, so are very accurate, is there anyway to filter out the inaccurate ones?

Hi mdl54

Well you could measure the total intensity of the cell body on the original image and filter. I personally would optimize the enhancespeckles, segmentation and smoothing. But mostly this is due to the original images with the bleeding light and multiple cell layers on the z plane. Is it possible to allow the cells to settle to the bottom of the plate or to mount them on a slide which would help with the large z area. There are many ways you can optimize to increase the segmentation.


How can I increase the segmentation and smoothing? I know for enchancespeckles I just need to find the right pixel range.
Unfortunately, I do not do the actual imaging, just the analysis, I’ll keep your suggestions in mind though, thanks for the help.

For the smoothing look into “smoothing keeping edges”. This may provide a better outline of your cells for better segmentation. For the segmentation, these are in the advanced section of the identify primary object module. Once you think you have the best identification of both the entire cell bodies and the vacuoles, I would look into the modules relate objects and identify tertiary objects, which will allow you to relate the objects. Then you can ask a number of biological questions from there.



I am having a similar issue with using the IdentifySecondaryObjects feature. In my case, the secondary object I want to define are my cells’ boundaries. I have stained HeLa cells with DAPI and a wheat germ agglutinin-lectin, which essentially stains the cell membrane. In CellProfiler, I’m working with two image stacks that were taken from the same position (one from the DAPI channel and the other from a 488 channel).

I have created a pipeline in which I used IdentifyPrimaryObjects for the DAPI stack of images so that I could identify the cell nuclei. Then I used IdentifySecondaryObjects for the WGA-stained stack of images. As shown below, the program is able to find the cells’ nuclei (green) but the outlining of cell boundaries (purple) appear random and undefined.

Is any way I can clean these images up (i.e. any settings within the IdentifySecondaryObjects that I can use)? I have attached my pipeline below along with the TIF files.

Any advice would be helpful. Thanks!

HeLa_WGA_DAPI.cpproj (533.5 KB)

**I wasn’t able to successfully load stacks into this post but I’ve included a slice from each channel at the same position.

DAPI_P1-0007.tif (8.0 MB)