How to obtain outline coordinates for each cell in an image

Hello, thank you for developing CellProfiler 2.0.

I have one question on how I can obtain outline coordinates for
“each of” the identified objects (cells).

Of course, I can save the whole outlines as one image using the
OverlayOutlines module (as discussed in
How to save/export outlines coordinates?),
but it seems to me rather difficult to separate outlines
for each cell, especially when the cells are packed/clumped.

Thank you for your help,


Maybe I should write what I would like to do with these outlines.

I would like to calculate the distance from the centroid to points
along the cell’s edge. This is similar to MetaMorph’s Inner Radius
and Outer Radius (cf. page 352 of … mmands.pdf),
but I’d like to obtain distance values in all directions along
the cell’s edge, not just the minimum and maximum values.

I have written a separate Python program for doing this, but to do
that I need the outline coordinates of each cell.

Alternatively, ImageJ (for example) can export outline coordinates
of a ROI, so if you can export CellProfiler outlines to ImageJ ROIs,
that’ll be fine.


One alternative may be to use ConvertObjectsToImage on the objects using the grayscale as the color type; this will give you the label matrix where the color value is the object label. You can then use ExpandOrShrinkObjects on the objects to shrink them by one pixel, and then use ConvertObjectsToImage on the result. If you subtract the shrunken label matrix image from the original label matrix image using ImageMath, you should get an outline image in which the outline color corresponds to the label. You can then save this new image using SaveImages, and additional processing can be used to extract the outline identity from the color, even if the outlines are touching.


Wow, thank you so much!! Now I can do it.

Summary: (Outline) = (Object) - (Object shrunk by one pixel)