Problem with PrimayObjectIdentification

Hi,
I am trying to use CellProfiler v2 to measure fluorescence intensity from neurons of different regions of interest (ROI) of rat hippocampus acquired as a whole montage. Only the neuronal cytoplasm in the sections are stained.
My work flow is as follows:-

  1. Load the image montage of the ROI to CP.
  2. Identify primary objects (nuclei) , secondary objects (cells) and tertiary objects (cytoplasm).
  3. Measure object intensity and object shape.
  4. Save image and export to spreadsheet.

However, when I run the pipeline, the “identifyPrimaryObjects” module make selections around the cells rather than the nuclei. And the ensuing “IdentifySecondaryObjects” shows only discarded cells (red labeled). I have been struggling with several combinations of thresholding, threshold correction factor, smoothing filter size and local maxima minimum distance. I will be most grateful for any suggestions .

I am attaching the pipeline and the image for reference

Thanks,

Melvi


NKCC1 Rev.1 For Testing CA3 MoGadaptive.cp (176 KB)

Hi Melvi,

The problem with the original pipeline is that no mask is being used for the original image, so the entire image is being used for nuclei identification.

I’m attaching a modified version of this pipeline; more tweaking will be required in IdentifyPrimaryObjects and IdentifySecondaryObjects. The main changes are the following:

  • Identification of the tissue from the image and masking with it.
  • Attempting to enhance the nuclei contrast by filtering with a filter size approximately the size of the nuclei diameter.
  • Inverting the pixel intensities so the nuclei appear light on a dark background for identification.
  • Using the original image for cell identification since the cell bodies are light on a darker background.

The nuclei are not easy for me to identify by eye so my attempt is approximate at best, so there is a fair number of false positives. Also, the cell contrast is so low that IdentifySecondaryObjects will have trouble finding the cell edges.

Regards,
-Mark
NKCC1.cp (179 KB)

1 Like

Hi Mark,
Thank you very much for the reply and the pipeline. I will tweak the primary and sec obj settings and will let you know how it goes.

Thanks again,
Melvi

[quote=“mbray”]
I’m attaching a modified version of this pipeline; more tweaking will be required in IdentifyPrimaryObjects and IdentifySecondaryObjects. [/quote]

Hi Mark,

Thank you very much for the modified pipeline. I have tweaked the primary and secondary object modules and now the pipeline seems to work fine. I would also like to do one more thing. I would like to assign the identified cells to separate layers (each layer having a thickness of one cell) and make measurements from cells occupying the two innermost layers of the DG.

I have tried using Define Grid and IdentifyObjectsInGrid modules. However, the grid shows only some of the identified objects. I am attaching the pipeline and the image for your reference.

Is it be possible to overlay a heat map of the intensity measurements of the cells identified in the image, instead of the actual values as is done by DisplayDataOnImage?

Thanking for your help,

Melvi


KCC2BasedOnBrayEditedByMelvi_DGForTestingRostroCaudalSectionsWithGrid.cp (187 KB)

Hi Melvi,

[quote=“melvimjm”]I would also like to do one more thing. I would like to assign the identified cells to separate layers (each layer having a thickness of one cell) and make measurements from cells occupying the two innermost layers of the DG. [/quote]In this case, unfortunately, DefineGrid and IdentifyObjectsInGrid won’t be helpful. Both of these are used to handle images/objects in a plate layout, where the spacing is regular, where your is not.

I think you have two alternatives in tackling this:
[ul][li]The first centers on an image-based approach:[list][]Convert the tissue into a binary image using ImageMath to invert the pixel intensities.[/li][li]Using the Morph module to do two operations on the binary image (you can do both in the same module, one after the other):[list][]A “close” operation to fill in small holes and fill in gaps. An example in MATLAB is shown here: mathworks.com/help/toolbox/i … 35678.html. The closing is needed prior since holes and gaps would be erroneously counted as boundary pixels otherwise.[/li][/ul][/:m][li]Using MesasureObjectIntensity to measure the object intensity of the cell objects against the distance image. This will effectively assign a distance measure to each object, but written as if it were an intensity measure.[/li][li]Use FIlterObjects to divide the cells based on intensity, and then begin making your measurements.Since the intensity is proportional to distance (since it was measured from the distance image), you can pick the intensity measure that’s most suitable, (e.g., the per-cell MeanIntensity will be the average distance of the pixels in the cell from the nearest boundary) [/li][/list:u] [/:m][li]The second centers on an object-based approach: [ul][] Identify the tissue as a single object. You can do this from the TissueMask image after using ImageMath to invert the pixel intensities.[/li][li]Use RelateObjects to relate the cells as “children” to the “parent” tissue object.In this module, you can also calculate distances from each child object to the parent object. If you chose “Minimum” as the distance method, it will calculate the distance from the child object centroid to the nearest edge of the parent object.[/li][li]Use FIlterObjects to divide the cells based on distance, and then begin making your measurements.[/li][/ul]However, with this option, there is a bug in how the distance measure is encoded in the current release, but has been fixed in our source code. A build of CellProfiler using our source code is available from here with the caveats mentioned (take note of the fact that pipelines made with the trunk buld are not backwards compatible. [/:m][/list:u]Essentially, these are two different ways of doing the same thing.

[quote=“melvimjm”]Is it be possible to overlay a heat map of the intensity measurements of the cells identified in the image, instead of the actual values as is done by DisplayDataOnImage?[/quote]Not as such. The closest approximate I can think of doing is using ClassifyObjects to bin the intensity measurement and have it displayed as part of the output; the rightmost panel shows each object color-coded by the measurement you provided. However, the objects are colored by the measurement bin number that the object falls in rather than the actual measurement value itself, so this is an indirect display of what you want.

Regards,
-Mark

Hi Mark,
Thank you very much for the reply. I will try all that you have suggested and will let you know how it went. As always, I am truly grateful for all your help and the amazing cellprofiler.

Thanks again,

Melvi