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

# MsrMeasureFunction

Measurement measure function

WARNING: this documentation page is outdated!

## SYNOPSIS

`#include "dip_measurement.h"`

dip_Error (*dip_MsrLineMsrFunction) ( measurement, featureID, label,intensity, size, objectID, dim, iterations )

dip_Error (*dip_MsrImageMsrFunction) ( measurement, featureID, label, intensity, objectID, iterations )

dip_Error (*dip_MsrChainCodeMsrFunction) ( measurement, featureID, objectID, chaincode, iterations )

dip_Error (*dip_MsrCompositeMsrFunction) ( measurement, featureID, objectID, composite, iterations )

## FUNCTION

The union `dip_MsrMeasureFunction` contains the following elements:

       dip_MsrLineMsrFunction      line;
       dip_MsrImageMsrFunction     image;
       dip_MsrChainCodeMsrFunction chaincode;
       dip_MsrCompositeMsrFunction composite;

The `measure` function is the function that performs the actual measurement. It The four different measurement functions `line`, `image`, `chaincode` and `composite` differ in the way the object label, shape and intensity information is provided.

The `line` measure function obtains two arrays (`label` and `intensity`) with label and intensity information of the to be measured objects. The `line` measurement function is called for every (X-) line in the image. Since `label` can contain more than one different labels, `line` itself is responsible for storing the measurement results for the appropriate object (using, for example, `MsrObjectData`). The object ID array `label` can contain values that are not present in `objectID`. These labels should be ignored.

The `image` measurement function is meant for measurement operation that need neighborhood or global object shape information for its operation (e.g. the `MsrSurfaceArea` function needs to evaluate the 6 connected neighborhood of each boundary voxel). The object ID image `label` can contain values that are not present in `objectID`. These labels should be ignored.

The `chaincode` measure function is meant for 2-D measurement functions that only require information on the shape of the object's contour, e.g. `MsrPerimeter`. The `chaincode` function is called for each object seperately, with the contour of that object stored in `chaincode`.

The `composite` measure function is meant for measurement function that derive their measurement function from the results of other measurement functions. The measurement functions this function is based on is obtained by calling the `MsrComposeFunction` callback function. The `composite` measure function obtains the results of these measurements through its `composite` function parameter (type: `dip_Measurement`). The `composite` function is therefore able to obtain these measurement results (e.g. by using `dip_MeasurementObjectValue`).

## ARGUMENTS

The argumenents of these functions are:

line:

Data type | Name | Description
`dip_Measurement` | `measurement` | Measurement data structure
`dip_int` | `featureID` | Measurement function ID
`dip_sint32 *` | `label` | Pointer to a list (image line) of object IDs
`dip_float *` | `intensity` | Pointer to a list of corresponding intensity values
`dip_int` | `size` | Size of the `label` and `intensity` list
`dip_IntegerArray` | `objectID` | Array of objectIDs to be measured
`dip_int` | `dim` | Dimension of the line, see `ScanFrameWork`
`dip_int` | `iterations` | Number of iterations the `measure` function needs to scan the data

image:

Data type | Name | Description
`dip_Measurement` | `measurement` | Measurement data structure
`dip_int` | `featureID` | Measurement function ID
`dip_Image` | `label` | Image with pixel intensities represending object IDs
`dip_Image` | `intensity` | Image containing corresponding intensity values
`dip_IntegerArray` | `objectID` | Array of objectIDs to be measured
`dip_int` | `iterations` | Number of iterations the `measure` function needs to scan the data

chaincode:

Data type | Name | Description
`dip_Measurement` | `measurement` | Measurement data structure
`dip_int` | `featureID` | Measurement function ID
`dip_int` | `objectID` | ID of the object to be measured
`dip_ChainCode` | `chaincode` | Chaincode data structure encoding the object's contour
`dip_int` | `iterations` | Number of iterations the `measure` function needs to scan the data

composite:

Data type | Name | Description
`dip_Measurement` | `measurement` | Measurement data structure
`dip_int` | `featureID` | Measurement function ID
`dip_int` | `objectID` | ID of the object to be measured
`dip_Measurement` | `composite` | Measurement structure containing the measurement data this function is based on
`dip_int` | `iterations` | Number of iterations the `measure` function needs to scan the data

## SEE ALSO

dip_MsrRegistry structure `MeasurementFeatureRegister`, `MsrCreateFunction`, `MsrValueFunction`, `MsrConvertFunction`, `MsrDescriptionFunction`, `MsrComposeFunction`

DIPlib on-line documentation | Function reference | Global function index