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

# MeasurementToHistogram

Creats a histogram for a measurement

## SYNOPSIS

`#include "dip_measurement.h"` `#include "dip_distribution.h"`

dip_Error dip_MeasurementToHistogram ( histogram, measurement, featureID, binSize, maximum, minimum, percentage, addMeasurement )

## DATA TYPES

integer

## FUNCTION

This function creates a (possibly multi-dimensional) histogram with the measurement results of one feature. If `addMeasurement` is `DIP_TRUE`, new data points are added to the existing histogram, and `binSize`, `maximum`, `minimum` and `percentage` input arguments are ignored. Otherwise, `histogram` is destroyed and recreated according to the chosen values for `binSize`, `maximum`, `minimum` and `percentage`. If `percentage` is `DIP_TRUE`, `maximum` and `minimum` represent a percentage of the data range, otherwise they represent absolute values. If `maximum` or `minimum` are `NULL`, the maximum or minimum of the data is used.

## ARGUMENTS

Data type | Name | Description
`dip_Distribution` | `histogram` | Output histogram
`dip_Measurement` | `measurement` | Measurement data
`dip_IntegerArray` | `featureID` | List of feature IDs to use
`dip_FloatArray` | `binSize` | Size of the histogram bins
`dip_FloatArray` | `maximum` | Maximum value represented in the histogram
`dip_FloatArray` | `minimum` | Minimum value represented in the histogram
`dip_Boolean` | `percentage` | Whether `maximum` and `minimum` are percentages
`dip_Boolean` | `addMeasurement` | Whether to add data to `histogram` or create a new one

## SEE ALSO

`Measure`, `MeasurementToImage`, `ObjectToMeasurement`