DIPlib Documentation - ©1995-2017 Quantitative Imaging Group, Delft University of Technology.

# FeatureShape

Measure shape parameters of the object

## SYNOPSIS

`#include "dip_measurement.h"`

dip_int dip_FeatureShapeID ( void )

## OUTPUT DATA TYPE

`dip_FloatArray`

## FUNCTION

`dip_FeatureShapeID` returns the ID value of this measurement function, that is registered by `Initialise`.

This function is a composite measurement function, that uses `FeatureSize`, `FeaturePerimeter`, and `FeatureFeret` to measure the following shape characteristics of 2D objects:

Squarity | `area` / ( `s` * `sp` )
Circularity | `area` / ( Pi/4 * `sp`^2 )
Triangularity | `area` / ( 1/2 * `s` * `sp` )
Elliticity | `area` / ( Pi/4 * `s` * s`p` )
Elongation | `p` / `l`

with `area` the size, `s` the shortest Feret diameter, `l` the longest Feret diameter, `sp` the Feret diameter perpendicular to `s`, and `p` the perimeter of the object. The values in the output array are given in this order.

When the measured object is either a perfect square, circle, triangle or ellipse, the values obtained by `FeatureShape` will be 1.0.

## NOTE

This function assumes isotropic sampling, even if the physical dimensions given through the `Measure` function say otherwise.

## NOTE

This function uses chain codes. It expects each measured object to be compact, that is, to have only one chain code. Additional chain codes are ignored, meaning that non-compact objects are not measured properly. Take care in providing the correct connectivity value: if you object is compact only with 2-connectivity, this measure will fail if you call `Measure` with a value of 1 for the connectivity.

## SEE ALSO

`Measure`

`FeatureAnisotropy2D`, `FeatureBendingEnergy`, `FeatureCenter`, `FeatureChainCodeBendingEnergy`, `FeatureConvexArea`, `FeatureConvexPerimeter`, `FeatureConvexity`, `FeatureDimension`, `FeatureExcessKurtosis`, `FeatureFeret`, `FeatureGinertia`, `FeatureGmu`, `FeatureGravity`, `FeatureInertia`, `FeatureLongestChaincodeRun`, `FeatureMass`, `FeatureMaxVal`, `FeatureMaximum`, `FeatureMean`, `FeatureMinVal`, `FeatureMinimum`, `FeatureMu`, `FeatureOrientation2D`, `FeatureP2A`, `FeaturePerimeter`, `FeatureRadius`, `FeatureShape`, `FeatureSize`, `FeatureSkewness`, `FeatureStdDev`, `FeatureSum`, `FeatureSurfaceArea`