Back to FabImage Library website
You are here: Start » Function Reference » Region » Region Relations » SortRegions

SortRegions
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationBasic |
Changes the order of regions from the input array according to an ascending/descending sequence of their computed feature values.
Syntax
C++
C#
void fil::SortRegions ( const ftl::Array<fil::Region>& inRegions, fil::RegionFeature::Type inFeature, fil::SortingOrder::Type inSortingOrder, ftl::Array<fil::Region>& outSortedRegions, ftl::Optional<ftl::Array<float>&> outSortedValues = ftl::NIL )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
inRegions | const Array<Region>& | Input regions | |
![]() |
inFeature | RegionFeature::Type | Region feature value to be computed | |
![]() |
inSortingOrder | SortingOrder::Type | Sorting order | |
![]() |
outSortedRegions | Array<Region>& | Regions sorted according to the computed feature values | |
![]() |
outSortedValues | Optional<Array<float>&> | NIL | Computed feature values |
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::NIL
to these parameters: outSortedValues.
Read more about Optional Outputs.
Description
The filter sorts the array of input regions according to the selected feature values computed for each of them.
Examples
![]() |
![]() |
SortRegions performed with inFeature = Area. Input regions are on the left. On the right is the result.
See Also
- SortArray – Changes the order of the input array elements according to an ascending/descending sequence of the value array.
- GetMaximumRegion – Returns the region from the input array that corresponds to the largest computed feature value.
- GetMinimumRegion – Returns the region from the input array that corresponds to the smallest computed feature value.
- ClassifyRegions – Splits an array of regions according to the selected feature and range.