DIPlib Documentation - ©1995-2010 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 measures the following shape characteristics of 2D objects:

    Squarity      = area / ( s * sp )
    Circularity   = area / ( Pi/4 * sp^2 )
    Triangularity = area / ( 2 * s * sp )
    Ellipsity     = area / ( Pi/4 * s * sp )
    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`

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