find_neighborsT_find_neighborsFindNeighborsFindNeighborsfind_neighbors (Operator)

Name

find_neighborsT_find_neighborsFindNeighborsFindNeighborsfind_neighbors — Search direct neighbors.

Signature

find_neighbors(Regions1, Regions2 : : MaxDistance : RegionIndex1, RegionIndex2)

Herror T_find_neighbors(const Hobject Regions1, const Hobject Regions2, const Htuple MaxDistance, Htuple* RegionIndex1, Htuple* RegionIndex2)

void FindNeighbors(const HObject& Regions1, const HObject& Regions2, const HTuple& MaxDistance, HTuple* RegionIndex1, HTuple* RegionIndex2)

HTuple HRegion::FindNeighbors(const HRegion& Regions2, Hlong MaxDistance, HTuple* RegionIndex2) const

static void HOperatorSet.FindNeighbors(HObject regions1, HObject regions2, HTuple maxDistance, out HTuple regionIndex1, out HTuple regionIndex2)

HTuple HRegion.FindNeighbors(HRegion regions2, int maxDistance, out HTuple regionIndex2)

def find_neighbors(regions_1: HObject, regions_2: HObject, max_distance: int) -> Tuple[Sequence[int], Sequence[int]]

Description

The operator find_neighborsfind_neighborsFindNeighborsFindNeighborsFindNeighborsfind_neighbors determines neighboring regions with Regions1Regions1Regions1Regions1regions1regions_1 and Regions2Regions2Regions2Regions2regions2regions_2 containing the regions to be examined. Regions1Regions1Regions1Regions1regions1regions_1 can have three different states:

The operator find_neighborsfind_neighborsFindNeighborsFindNeighborsFindNeighborsfind_neighbors uses the chessboard distance between neighboring regions. It can be specified by the parameter MaxDistanceMaxDistanceMaxDistanceMaxDistancemaxDistancemax_distance. Neighboring regions are located at the n-th position in RegionIndex1RegionIndex1RegionIndex1RegionIndex1regionIndex1region_index_1 and RegionIndex2RegionIndex2RegionIndex2RegionIndex2regionIndex2region_index_2, i.e., the region with index RegionIndex1RegionIndex1RegionIndex1RegionIndex1regionIndex1region_index_1[n] from Regions1Regions1Regions1Regions1regions1regions_1 is the neighbor of the region with index RegionIndex2RegionIndex2RegionIndex2RegionIndex2regionIndex2region_index_2[n] from Regions2Regions2Regions2Regions2regions2regions_2.

Attention

Covered regions are not found!

Execution Information

Parameters

Regions1Regions1Regions1Regions1regions1regions_1 (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Starting regions.

Regions2Regions2Regions2Regions2regions2regions_2 (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Comparative regions.

MaxDistanceMaxDistanceMaxDistanceMaxDistancemaxDistancemax_distance (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Maximal distance of regions.

Default value: 1

Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 10, 15, 20, 50

Typical range of values: 1 ≤ MaxDistance MaxDistance MaxDistance MaxDistance maxDistance max_distance ≤ 255

Minimum increment: 1

Recommended increment: 1

RegionIndex1RegionIndex1RegionIndex1RegionIndex1regionIndex1region_index_1 (output_control)  integer-array HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Indices of the found regions from Regions1Regions1Regions1Regions1regions1regions_1.

RegionIndex2RegionIndex2RegionIndex2RegionIndex2regionIndex2region_index_2 (output_control)  integer-array HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Indices of the found regions from Regions2Regions2Regions2Regions2regions2regions_2.

Result

The operator find_neighborsfind_neighborsFindNeighborsFindNeighborsFindNeighborsfind_neighbors returns the value 2 (H_MSG_TRUE) if the input is not empty. The behavior in case of empty input (no input regions available) is set via the operator set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>). The behavior in case of empty region (the region is the empty set) is set via set_system('empty_region_result',<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>). If necessary an exception is raised.

Possible Predecessors

thresholdthresholdThresholdThresholdThresholdthreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, connectionconnectionConnectionConnectionConnectionconnection

See also

spatial_relationspatial_relationSpatialRelationSpatialRelationSpatialRelationspatial_relation, select_region_spatialselect_region_spatialSelectRegionSpatialSelectRegionSpatialSelectRegionSpatialselect_region_spatial, expand_regionexpand_regionExpandRegionExpandRegionExpandRegionexpand_region, distance_transformdistance_transformDistanceTransformDistanceTransformDistanceTransformdistance_transform, interjacentinterjacentInterjacentInterjacentInterjacentinterjacent, boundaryboundaryBoundaryBoundaryBoundaryboundary

Module

Foundation