Excluding cell outlines on image edge


I want to exclude whole cells whose outlines are partially cut off by the image border. When the nucleus is also cut off, this is not a problem. But when the nucleus is wholly on the image, the program includes the image’s horizontal / vertical edge as part of a cell’s outline. How should I fix this?


Hi Greg,

One solution is fairly convoluted; basically, it expands the objects to match the outline border, and then finds the ones that intersect the image border using an intensity measurement:

  • ExpandOrShrink: Expand the objects by one pixel to match the outline border

  • ConvertToImage, using Grayscale as the color

  • Crop: Crop the converted image, using Rectangle as the shape, ‘2,end-1’ as the left/right and top/bottom pixel positions, and ‘no’ to removing rows and columns that lack objects

  • ImageMath: Subtract the cropped image from the converted image

  • MeasureObjectIntensity: Use the expanded objects and measure on the subtracted image

  • FilterByObjectMeasurement: Filter the expanded objects by the integrated intensity, with maximum value of zero

May I ask why you would want to do this? The outlines are typically meant for display purposes and aren’t data per se. If the outlines should be part of the identified object, then perhaps your threshold in IdentifyPrimAutomatic/IdentifySecondary is too strigent…


Thank you for your help. I will try that method.

I want to use the outlines to measure cell area. Thus, I need to exclude the ones that are cut off so as not to skew my data.


You could use MeasureObjectArea for that purpose. Are you finding that it doesn’t suit your needs?


The cells are not necessarily of uniform size, so MeasureObjectArea might not be appropriate. In any case, I got it to work. Thank you very much for your help.


Good to hear! If you can suggest improvements to MeasureObjectArea to get it work better for your purposes, please let us know.