Cell Segmetation issues

I am trying to identify the nucleoli, nucleus and cells, but I have been encountering some difficulties in the cell segmentation. The cell outlines are appearing as huge zigzagged borders that contain more than one nucleus. I’ve tried to tamper with the regularization factor in the IdentifySecondaryObjects module but I can’t seem to find a difference.I then created a different pipeline that identifies both the nuclei and cells as primary objects and then added in the RelateObjects module. I tampered with the Suppress local maxima value but also saw no difference. I would greatly appreciate it if you could clear out this cell outline issue I’m having.

Here are both pipelines and the flex file I’m using:
pipeline 20: Primary and secondary objects (nuclei and cells)
pipeline 21: Two primary objects (nuclei and cells)
005001000.tiff.zip (6.27 MB)
pipeline21-nosmoothing-notexture-nosecondaryobject.cp (19 KB)
pipeline 20.cp (18.1 KB)

Hi,

It appears that you are using a very old version of CellProfiler to create this pipeline (verison 10415, it seems). I tried it with the latest version, but it appears that it won’t load the file (is it a multiframe TIF or FLEX file?). In any case, I suggest the following:

  • Go to this page
    and download our trunk build version. This is a pre-release that will successfully load the file. - I’m attaching a pipeline that should work with the trunk build. I removed extraneous modules and adjusted some settings to better find the nucleus and cells, although I have to admit, I can’t discern the nucleoli from your images.

Regards,
Mark
2013_09_20.cp (12.9 KB)

[quote]/quote

Thanks alot for your help. the pipeline worked great. I changed a few things though regarding the image channels inputed into the identify primary and secondary objects modules. I guess I forgot to mention that the image contains two channel, the first is a GFP channel tagging the nucleolus while the second is a RFP channel tagging both the nucleus and the cell. I also added in the expand object module for the nucleus so it can be able to detect to nucleoli lying in the expanded nucleolar field if nucleolar flares are present. I am now having difficulties with detecting the nucleoli in the GFP channel. I tampered around with the threshold but no difference was observed. I am wondering if this has anything to do with the two and three class thresholding?
Also, can you please explain to me what does the mask object module do?
Thanks alot in advance, looking forward to hearing back from you.

Regards, Leen
Nucleoliproblem.cp (15.5 KB)
012013000.flex - APQ12.zip (6.39 MB)[/quote]

It appears that some of the nucleoli are being excluded because they touch the edge of the mask (the ones with the yellow outlines). Uncheck the “Discard objects touching the border of the image” and you should pick them back up.

The MaskImage module serves to exclude regions outside the objects from consideration in thresholding. It is not always necessary, but it is helpful if the features of interest take up very little image area and are embedded within a cellular background intensity which is higher than the actual background.

I should mention that including the RescaleIntensity module is really not necessary, and will lead to adverse results if the image happens to have no objects. It also often precludes finding a consistent automatic thresholding method thatworks across multiple images, since each image is rescaled differently.

Regards,
-Mark

Hi Mark,

This masking type operation is one that our group needs to use frequently. Would it be possible to turn this question into a sample or tutorial pipeline? It would really help our all the imaging groups at Toronto that use Evotec Opera.

Thanks,

Lee.

[quote=“mbray”]It appears that some of the nucleoli are being excluded because they touch the edge of the mask (the ones with the yellow outlines). Uncheck the “Discard objects touching the border of the image” and you should pick them back up.

The MaskImage module serves to exclude regions outside the objects from consideration in thresholding. It is not always necessary, but it is helpful if the features of interest take up very little image area and are embedded within a cellular background intensity which is higher than the actual background.

I should mention that including the RescaleIntensity module is really not necessary, and will lead to adverse results if the image happens to have no objects. It also often precludes finding a consistent automatic thresholding method thatworks across multiple images, since each image is rescaled differently.

Regards,
-Mark[/quote]

Hi Mark,

Thanks again, that did solve the issue.
As for the rescale intensity, when I remove that module I get pitch black images. Tried to open them with ImageJ instead of Preview but they still look the same. Do you have an suggestions for why that might be happening?

I’ve got another issue that it also confusing me, in the default excel spreadsheets produced for the three objects (cell, nuclei and nucleoli), the number of objects in each image do not match across all three spreadsheets. So that would mean that the numbers designated to the objects ( cell, nuclei or nucleoli) for each image listed in the spreadsheets do not correspond back to the same object (the entire cell). Does object 1 in image 1 in the GFP channel correspond to object 1 in image 1 in RFP channel?
I would like to be left with the objects found in both channels only, and would like to have the numbers corresponding to the same object.
Would greatly appreciate your help with this last matter.

Regards,
Leen

Strangely, not rescaling the image prior to overlaying the outlines causes the color outlines to become grayscale. So I suggest placing the recaling modules just before the OverlayOutlines modules. Generally speaking, if rescaling needs to be done for output purposes, it’s best to do it after the object identification/measurements modules, which are the ones where you are best served by using the raw images. Also, I suggest changing the image format in SaveImages to PNG over TIF for smaller file size.

I should also mention that the rescaling + outline issue has been fixed in our code, so adding the rescaling module will not be necessary after our next release.

No, there’s no guarantee that would be the case. Using IdentifyPrimary for nuclei and IdentifySecondary for cells does ensure a one-to-one correspondence between the object numbers. However, for two unrelated sets of primary objects, e.g., nuclei and nucleoli, the correspondence between them must be imposed by the RelateObjects module, since you could have multiple nucleoli objects per nucleus. By using RelateObjects, each child object will have a corresponding parent object written to the spreadsheet and vice versa.

I would suggest using the FilterObjects module after the RelateObjects module. Use the ExpandedNuclei as the input object, and filter by Children as the category and Nucleoli_Count as the measurement. Enter 1 for the minimum value and uncheck the “Filter using maximum measurement” box. The result of these settings is to remove those parent objects with 0 children; the remaining objects are those with 1 or more children, i.e, co-localized RFP parents and GFP children.

Regards,
-Mark

Hi Mark,

So I added in the filter module you mentioned, but then I noticed that it is only filtering in one direction. For ex: filtering out the nulcei that have no nucleoli. So I added in another filter module that does the exact opposite, filtering out the identified nucleoli that have no nuclei. I also relabelled the cells to filtered cells under the first filter module, in hope that that would only label the cells with nuclei that have a nucleolus.
Unfortunately the output spreadsheets (filterednuclei, filterednucleoli and filteredcells) don not have matching numbers of objects in corresponding cells. There must be some error in my filtering modules. Any suggestions for why that might be happening?

Thanks,
Leen
012013000.flex - APQ12.zip (6.39 MB)
pipeline2filters .cp (17.4 KB)

I’m not sure I understand here. How can you have nucleoli with no associated nucleus?

[quote=“leenashqar”]So I added in another filter module that does the exact opposite, filtering out the identified nucleoli that have no nuclei. I also relabelled the cells to filtered cells under the first filter module, in hope that that would only label the cells with nuclei that have a nucleolus.
Unfortunately the output spreadsheets (filterednuclei, filterednucleoli and filteredcells) don not have matching numbers of objects in corresponding cells. There must be some error in my filtering modules. Any suggestions for why that might be happening?[/quote]

Using the two FilterObjects modules, you now have three sets of new objects. There should be a one-to-one correspondence between FilteredNuclei and FilteredCells since you specified the relationship between them there. However, there is no necessary relationship between these and FilteredNucleoli; as before, you must use RelateObjects to establish the relationship between them.

Regards,
-Mark

Hi Mark,

So with and without the second filter option I added in, I get different numbers of nuclei and nucleoli detected in the same image when comparing the GFP and RFP channels. I’ve attached below a copy of the spreadsheets. You can see for image 1 for instance, 16 filtered nuclei were detected while 18 nucleoli were detected. How can I make the object numbers the same in the same image? 16 nuclei and 16 nucleoli in image 1 for instance.

Thanks,
Leen
DefaultOUT_Nucleoli.csv (317 KB)
DefaultOUT_Filterednuclei.csv (316 KB)

Whether this is possible depends in part on how good your object identification is and what your objective is.

For example, the identified nuclei screenshot below is taken from a portion of the 3rd frame of your attached flex file. You can see that the nuclei are not identified well in this case.


The next screenshot from the RelateObjects module with the same nuclei and associated nucleoli.
You can clearly see here that the # of nuclei and # of nucleoli will not match in this case.

But keep in mind that even if you did improve the quality of the nuclei identification, you cannot guarantee that only one nucleoli is identified per nucleus the way the pipeline is now. Also, would you want to? That is, do you know biologically that this must be true, and do you want to overlook instances where it not be the case?

If you know that this must be true (because you’ve set up your assay to make it so or the biology demands it), my suggestion would be to identify the nucleoli using IdentifyPrimaryObjects (as you have now) and then use IdentifySecondaryObjects to identify the nuclei/cells with the nucleoli as input objects. Since there is always a one-to-one correspondence between primary and secondary objects, the number of nuclei and nucleoli will always be the same and have the same object numbers. Keep in mind that if the nucleoli are not detected well, then by this method the nuclei/cells will not be detected properly either.
-Mark