Studio Yotsuba
Back to Node List

Region Adjacency

region_adjacency

Lists which regions touch which. An info node: it draws nothing, but feeds neighbor relationships to other nodes or to your own inspection

Reviewed
Guide available

Input Ports

NameTypeDescription
Regions
regions
RegionMap
Required
RegionMap to analyze

Output Ports

NameTypeDescription
Adjacency
adjacency
Map
Region adjacency map
Region Entries
region_entries
List<Map>
Per-region adjacency entries for List nodes
Pairs
pairs
List<Map>
Adjacent region pairs for List nodes
Region Count
region_count
Int
Number of regions
Pair Count
pair_count
Int
Number of unique adjacent pairs

Parameters

NameTypeDefaultRangeDescription / Options
Include Outside
include_outside
Bool
false—

Include explicit OUTSIDE pixels (region -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