How to measure or calculate object triangularity?

I need to filter puncta-like objects in the image. I would like to discard the ones with triangular shape. How can I accomplish that?

Hi There,

I would try to use a combination of measurements in the classifier module like:

Eccentricity and then Extent. Those should separate triangles from round objects.

See the attached example dummy image with different triangles and circles (original) and the resulting classified image using eccentricity and extent means to classify (pipeline is attached).



triangle_classifier.cpproj (285.5 KB)

1 Like

Thank you! However it did not help the way I was hoping for, I think the calculated triangularity measurement would be useful. Take a look at the image below. As you can see the last couple of puncta clearly triangular shape, which are false and I am trying to get rid of them. Best, Jama.

We do have a similar module (MatchTemplate) in the works (where you could use a triangular model as a template), but as of right now it can only be used by directly downloading the source code of CellProfiler and running it from there. It’ll hopefully be ready in a sometime-soon release!

If you’re running CP >2.2, in TestMode there’s a button labeled WorkspaceViewer- you can use that to look at all the different size and shape measurements of your puncta next to the puncta themselves- by toggling through the list you can look at them all and see which ones might be most helpful to distinguish triangular objects.

Hi Jama,

Can you post a few raw images? Hard to tell from the mask…

We’ve had good luck with determining rules for classifying objects by taking a few images and then scoring their triangularity manually and then use partial least squares regression to identify the appropriate set of features to use to isolate a subtle phenotype.

Also, this would be a good case to use CP Analyst and pick the triangular cells and dump them into a class and everything else into a different class. That’ll generate a rule set you can use to classify with also.



1 Like