Flag border-touching objects instead of removing them for accurate objects relation

cellprofiler
identifyprimary

#1

Hi developers,
I was wondering if it is possible to flag objects touching image border instead of removing them and to find this info in the final exportToExcel output file?

I’m trying to locate nuclei into muscle fibers on histological sections. Nuclei are in the periphery of fibers, sometimes in-between 2 of them. If one fiber is touching the image border, then the nuclei can be mislocated to the second fiber if I remove touching objects. Keeping all objects works well but Area/shape analysis cannot be performed on truncated fibers that’s why I would like to be able to filter out border-touching fibers in the final excel file.
I uploaded an example picture (fibers are red delimited, nuclei are blue, white lines represent nuclei to fiber center of gravity relation obtained with the “relate” module)


for example the bottom-left fiber has 2/3 nuclei that are mi-slocated if that fiber is remove because touching the image border.
I already tried to keep all fibers and filter after in the datatable using shape features but it is not robust and vary from image to image.

Best,


#2

Hi,

Here’s how I’d handle that- it’s a bit wonky but it should work-

Run your “identify” module twice- once keeping all of them (call that, say, “Fibers”) and once throwing out the ones touching the edges (call them “FibersNoEdges”). Do all your measurements on “Fibers”, then use “RelateObjects” to relate your “Fibers” as parents and your “FibersNoEdges” as children. Fibers on the edge will have Fibers_Children_FibersNoEdges == 0 in your database and you can throw them out in your area analysis downstream.

Does that make sense?


#3

Hi, thanks a lot, that makes sense, I didn’t though about that alternative :slight_smile:
It should work,
thanks again,
Best,