Back to Node List

Region Adjacency

region_adjacency

Outputs neighboring region relationships as Map data

Reviewed
Guide available
The node name and summary are available in English. Port, parameter, and article details are currently shown in Japanese.

Input Ports

NameTypeDescription
領域
regions
RegionMap
Required
隣接関係を調べる RegionMap です

Output Ports

NameTypeDescription
隣接情報
adjacency
Map
領域同士の隣接情報です
領域一覧
region_entries
List<Map>
Listノードへ接続できる領域ごとの隣接情報です
隣接ペア
pairs
List<Map>
Listノードへ接続できる隣接領域ペアです
領域数
region_count
Int
領域の数です
隣接ペア数
pair_count
Int
重複を除いた隣接領域ペアの数です

Parameters

NameTypeDefaultRangeDescription / Options
外側を含む
include_outside
Bool
false

RegionMap内の明示的なOUTSIDEピクセル(領域 -1)を隣接情報に含めます

Overview

An information node that outputs which regions touch which other regions as Map data. It produces no image; it returns the adjacency graph—including pairs and shared-border lengths—as numbers. This data supports advanced region logic in expression and list-processing nodes.

  • Category: Generate / Region / Info
  • Uses: rule processing, inspecting region relationships, and supplying data for downstream merge or selection logic

Usage tips

  • If you only need to create regions or a mask, region_neighbor_select is more direct. Use region_entries or pairs when you need to process adjacency data with expressions in list_map or list_filter; both are directly connectable List outputs.
  • border, the number of shared edges, is especially useful. It enables weighted conditions such as selecting only pairs with a long shared boundary.

Related nodes

  • region_neighbor_select — practical adjacency-based selection
  • region_info — information about individual regions
  • list_map / list_filter — process the output data

Output

adjacency is a Map containing mainly the following fields.

Key Contents
region_count Number of regions
wrap_x Whether the left and right edges connect
wrap_y Whether the top and bottom edges connect
regions Each region's id, neighbor_count, and neighbors
pairs a, b, and border for each adjacent pair

The main data is also available through direct outputs.

Output Type Contents
region_entries List Per-region adjacency information
pairs List Adjacent pairs and shared-border counts
region_count Int Number of regions
pair_count Int Number of unique adjacent pairs

border is the number of horizontal or vertical edges shared by the two regions. A larger value means they touch along a longer boundary.

When the input RegionMap has horizontal or vertical wrapping, contacts across the left/right or top/bottom edges are also included as adjacent pairs.

Include Outside includes only contact with explicit OUTSIDE_ID = -1 pixels inside the RegionMap. It does not invent virtual outside pixels around a non-wrapped canvas.

This node outputs information only and has no preview image of its own. To create actual regions or a mask from adjacency, use Region Neighbor Select.

Back to Node List
Region Adjacency — PixPipeline Node Reference