Dilate the regions in a labelled image
#include "dip_regions.h"
dip_Error dip_GrowRegions ( in, grey, mask, out, connectivity, iterations, order, method )
in: binary, integer
grey: interger, float (converted to dip_sfloat)
mask: dip_uint8
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 and method are 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. method selects the method used to store and sort the pixels. For small 2D images it is better to use the stack (DIP_SORT_INSERTION_SORT). When the stack gets too large, this is very inneficient, and it's better to use the heap (DIP_SORT_HEAP_SORT). However, the latter is only good if the grey-value image does not have any plateaus. So if you use an integer grey-value image, try the stack. The value DIP_SORT_DEFAULT selects the more efficient heap.
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 |
dip_SortType | method | The method used to store and sort the pixels |
The dipf_GreyValueSortOrder enumeration consists of the following flags:
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. |
GrowRegionsWeighted, Watershed, BinaryPropagation, Label
DIPlib on-line documentation | Function reference | Global function index