Region (table)¶
Detects and manages regions in table data: areas of a two-column plane,
for example a bright population in FSC-A / SSC-A, or a cluster in an
unmixed channel plane. Each Region can be converted to a 0/1 column that
downstream modules use like any other numeric channel.
This module works only with table files. Images use Region; the two modules are independent and keep separate state.
The page¶
| Area | Contents |
|---|---|
| Left top left | The table files used by this module. |
| Left top right | Axes: the X and Y columns and their display transforms. |
| Left middle | Internal detection gates (rect / ellipse / polygon / boolean). |
| Left bottom | The Region tree: Region → Sample → Sub-region, with Convert as channel, Status and Downstream visible. |
| Middle | Scatter preview with the Gating and Region tools; the detection panel is below it. |
| Right top | Plot settings: file and colour channel with Min/Max, histogram, Auto set and Reset. |
| Right middle | Region setting: drawing style of the selected Region. |
| Right bottom | Log: detection progress and results. |
Axes¶
X and Y choose the two numeric columns the plane is made of; the axes are linear. Region boundaries are stored in those columns' data values.
Changing the X or Y column changes the plane, so the module asks first and then clears the Regions. Changing the range percentiles or the grid does not touch existing Regions.
Plot settings¶
File chooses the previewed file. Channel colours the scatter points by one numeric column of that file; the Min/Max fields below it set the colour range, with the channel's signal histogram, Auto set (0.5 % and 99.5 % percentiles) and Reset (full range). The histogram is read from a sample of the channel, so it is instant on large tables. These settings only affect the preview, never detection or a converted Region.
Detection¶
Detection sorts the events of each file into a grid and traces the bins whose value stands out. The file button at the top of the panel chooses which files detection runs on (all files by default); every other file keeps its Regions untouched.
- Sample: a deterministic sample of up to 200 000 rows per file gives the
X/Y range and the signal cut-off. The results are written to the log and
marked
sampled. - Axis range: each file's own X and Y range between the Axis range percentiles (default 0.1 % – 99.9 %). Files with very different ranges are each covered in full.
- Signal cut-off (only in Median above cut-off mode): per file, the value of the signal column at the Signal cut-off top percentage (default 5 %). Only events above it take part in a bin's value. A larger percentage lowers the cut-off and uses more events; a smaller one keeps only the brightest.
- Grid: Grid W × H bins over the axis range, plus one extra ring of bins around the range. Events outside the range are placed in that ring, so a Region that reaches the border is not cut off; the log reports how many events were clamped and how many lie beyond the ring. The Show checkbox next to the grid size draws the grid (including the ring) on the plot.
- Bin value, chosen with the Bin value menu at the top of the panel:
- Median (all events) (default) — the median signal of every event in the bin. This suits tables whose rows are cells or objects.
- Median above cut-off — the median of only the events above the per-file signal cut-off. This suits dense pixel-level tables, where a bin holds many rows.
A bin with fewer than Min events/bin events of the chosen kind is
empty.
6. Signal Expansion: count-weighted Gaussian smoothing (sigma in bins),
the Bin threshold (default: a per-file 95th percentile; Otsu or a
manual value can be chosen; a larger percentile or value raises the
cut-off, so fewer bins pass), morphological expansion (default 1 bin),
hole filling and a minimum area — all in bin units — then polygon tracing
with Tolerance in bins (default 0, so the traced outline is kept as
it is).
7. The contours are converted back to data coordinates and stored as
Sub-regions of a new Region (Region 1, Region 2, …).
Every file reports its ranges, cut-off, bin and event counts, and step times in the log. A run creates a new Region; it never merges into an existing one.
Internal detection gates¶
The gate tree limits where detection runs. Draw a gate with the Gating tools while a gate (or Root) is selected; the new gate becomes its child. Gates support rectangle, ellipse, polygon and boolean (NOT / AND / OR) types and per-file geometry, exactly like Gating. Gates are private to this module and are never visible downstream.
Editing a Region¶
- Region in unions a filled polygon into the selected Region (or creates a new Sub-region). Region out subtracts the drawn polygon from the selected Sub-region; an out that removes all of it deletes the Sub-region.
- As in the image Region, every edit combines the polygon with the existing area (union for in, subtraction for out) and then re-traces the boundary. Overlapping or nested polygons therefore never leave even-odd holes, and a cut always removes area. Table coordinates have no pixel grid of their own, so the local mask is sampled at 512 cells across the longer side.
- A Sub-region is still the even-odd fill of its
inandoutrings, so an island inside a hole needs no extra bookkeeping. Edit boundary anchors are not available; use the Region in / Region out tools instead. - Region, Sample and Sub-region can be renamed, copied, pasted and deleted from the Region tree.
- The tree remembers which rows are expanded and which are ticked in Show when the module is saved. Adding, deleting or detecting a Region never expands the whole tree and never re-shows hidden Regions: every row keeps the state it had, and only a newly detected Region opens.
Converting a Region¶
Press Convert to write the Region on every file that has a Sample. The module writes one companion parquet per source file with a 0/1 column per converted Region, and Downstream visible publishes that column.
| Column | Meaning |
|---|---|
| Convert as channel | Writes the Region as a 0/1 column for every Sample. |
| Status | Not converted, Converting n/m, Converted, Partial, Needs update or Failed. |
| Downstream visible | Off by default; available when every Sample is converted. |
Conversion tests every row against the polygons in the original data coordinates, so it is exact for the stored boundary. Events beyond the one-bin edge ring are outside the polygon and convert to 0.
Conversion runs in the background, including the check that the Region's name is not already a column in one of its files, so Convert stays responsive with many files. Each finished file is reported in the module log, and the Region row shows its progress.
Region Size reads these converted columns: it lists the Region, names its X/Y columns, and measures either the event count or the exact coordinate area of the stored polygons.
What downstream modules see¶
A converted, downstream-visible Region is an ordinary numeric column: it can be plotted on a Figure axis, used in a Heatmap, aggregated by Feature Down, turned into a feature, or exported. A file without a Sample has no such column and is reported as unavailable.
Notes¶
- Detection parameters are per file where they must be (ranges, cut-off, thresholds) and per module where they define the grid.
- Very large files: detection reads at most ten million rows, using a deterministic spread sample beyond that and noting it in the log.
- Grid bins are the detection unit: Smooth, Expand, Min area and Tolerance are all in bins.
- The module stores its Region tree in
Module/<id>/regions.jsonand its converted columns inModule/<id>/.
Related¶
Region · Region Size · Gating · Gate2Col · Figure