Measuring Edge Objects Excluding Edge


Was wondering if anyone had a solution to a problem that we are having.

We are trying to measure the cell membrane of cells. After defining the membrane region, is there a way to measure objects that touch the edge of the image without measuring the portion of the object actually on the edge of the image?


Thank you for any help!


Hm, interesting question. How about this: let’s say you have defined the membrane region as the outermost 3 pixels of the cell. After identifying the membrane region, use ConvertToImage to convert the Membrane region “objects” to an image. This will allow you to run it through a Crop module, where you can use the rectangle option to crop your image by 3 pixels, eliminating those parts of the membrane regions that are touching the edges. Now, run the result of the Crop module back through an IdentifyPrimAutomatic image to convert the image back to objects again.

Ideally, you wouldn’t need to go through all these steps, you could just run a Crop module directly on the membrane regions objects themselves, but because CellProfiler treats “images” as different from “objects”, it won’t work directly and so you have to convert the objects to an image and back again.

If you need to keep the measurements of the membrane regions associated with other objects in the pipeline, you might need a Relate module to re-associate them.

Does this help?