Calculate a new feature with features already present

Hello, I would like to calculate a new feature in the detections table (so that I can use it in the measurements map).

This new feature is called “E”

The formula to calculate it is:

E = Area * 2 * rad (Maxdiameter * Maxdiameter * 2 + Mindiameter * Mindiameter * 2) / (Lenght * Maxdiameter * Mindiameter)

My detection table is as follows:

Could someone create a script to automatically calculate it? thank you

In this context, what exactly is rad?

212/5000

If by “rad” you mean that the values of the features don’t change, I think so. These are annotations converted into detections, then i add Area, Diameters and Lenght (so all you need for the formula) from analyze> calculate features> add shape features

I meant rad here:

Anyway, here’s a script that shows how to add custom measurements. You may need to adapt the name and the calculation to do exactly what you want (I ignored rad since I wasn’t sure what it meant).

2 Likes

Thank you, Pete! For “rad” I meant “square root”. I put “Math.sqrt” in the formula. It runs! :slight_smile:

1 Like