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

# GrowRegions

Dilate the regions in a labelled image

## SYNOPSIS

`#include "dip_regions.h"`

dip_Error dip_GrowRegions ( in, grey, mask, out, connectivity, iterations, order )

## DATA TYPES

`in`: binary, integer

`grey`: interger, float (converted to dip_sfloat)

`mask`: `dip_uint8`

## FUNCTION

The regions in the input image `in` are grown with several options:

If `grey` is `NULL`, the regions are dilated `iterations` steps, according to `connectivity` (see The connectivity parameter), and optionally constrained by `mask`. This is the labelled equivalent to `BinaryPropagation`. If `iterations` is 0, the objects are dilated until no further change is possible. `order` is ignored.

If an image `grey` is given, the labels are grown in order of the grey-values in `grey`. `order` indicates whether pixels with high grey-values are added first or last. `iterations` is ignored, and `mask` is an optional constraint. This is a watershed algorithm with initial labels. The function `Watershed` does not accept an initial segmentation, so these two functions complement each other. Note that `GrowRegions` does not leave any watershed pixels in between the regions.

## ARGUMENTS

Data type | Name | Description
`dip_Image` | `in` | Input binary or labelled image
`dip_Image` | `grey` | Input grey-value image
`dip_Image` | `mask` | Mask image
`dip_Image` | `out` | Output binary or labelled image
`dip_int` | `connectivity` | Connectivity
`dip_int` | `iterations` | Number of iterations
`dipf_GreyValueSortOrder` | `order` | Whether to grow from low to high or high to low

The `dipf_GreyValueSortOrder` enumeration consists of the following values:

Name | Description
`DIP_GVSO_HIGH_FIRST` | Process the pixels from high grey-value to low grey-value.
`DIP_GVSO_LOW_FIRST` | Process the pixels from low grey-value to high grey-value.

## SEE ALSO

`GrowRegionsWeighted`, `Watershed`, `BinaryPropagation`, `Label`