IdentifySecondaryObject based on primary object from different RGB channel

Hi, I have DAPI images and after identifying nuclei as primary objects (blue channel) I am trying to identify gene stains (from red and green channels) as secondary objects, based on the primary nuclei
(I am having trouble with “cathching” the secondary objects and instead just end up with the same primary objects).

How would be best to do so?

Hi Shimmy,

You’ll likely get better help if you provide more details (like images) :slight_smile:
Start here for hints: BEFORE POSTING - Please read this

Attached are the images where you can see :

  1. Separating original colour image to separate grayscale channels.
  2. Identified primary nuclei objects in blue channel.
  3. Identified primary objects in red channel.
  4. Attempting to identify object in red channel as secondary in relation to blue channel’s nuclei - unsuccessfully.
  5. Attempting to use “RelateObjects” instead of IdentifySecondaryObjects in order to find which objects on red channel fall within the area of the nuclei objects from blue channel (which is my objective). It is not clear to me if it based the result on both objects correctly or if this is weak result.

Any suggestions on how to do this better?

RGB primaryBlue primaryRed secondaryRedPrimaryBlue relateBlueRed

Hi Shimmyb

It would be a lot easier to figure it out if you could give a representative image and your pipeline.

Just by looking I would say that you are not thresholding correctly. Is this OTSU? Have you adjusted the OTSU setting? Are you able to define the cell bodies? Are you segmenting the cell bodies that touch?


In my previous reply are representative images and now I am attaching also my pipeline.
Yes I am using Otsu. I am segmenting the blue channel which is the nuclei and want to count only the green and red gene FISH stains which fall only on top of the blue nuclei.

I am mainly confused as to which action I should use in general, and if “relate objects” is the correct one then I am confused what I should give as parent and child objects? Right now I am giving “primary object” results of the blue nuclei as parent and “primary object” results of the red/green channels as children.

Any further tips on how to do this correctly would be appreciated.
Thanks in advance,

firstTry.cpproj (672.1 KB)

Could you upload the representative images with the original resolution that you are using in the pipeline? It would be helpful to debug what the issue could be.


yes sorry I thouhgt I had previously uploaded this but I was mistaken.
So far I ran the pipeline on only one picture which is attached to this message.
Will very much appreciate any advice once u run the pipeline on this image.

Thanks in advance,
MAX_WT 5 slc38a1 myoc mfge8 dapi 40x.nd2 (RGB).tif (12.0 MB)

I have no experience with nuclei or gene imaging but I assume you want to identify the gene stains (small spots visible in red-green channels) that lie inside the nuclei (big shapes visible in the blue channel).

After separating your example image, I have noticed the red channel is saturated compared with the other channels. Even I don’t think this is problematic, it would be better to solve this in the image acquisition phase.

If your objective is to segment the gene stains that lie inside the nuclei, a simple approach would be:

  1. Threshold the blue channel and apply a morphology open (erode+dilate) to remove small objects that are no nuclei
  2. Multiply the resulting binary image to the red and green channels to mask the pixels that do not line inside the nuclei
  3. Threshold the masked red and green channels and segment
  4. Filter the resulting objects by size or geometry to remove artifacts