Filter regions

Analysis › Regions · version 1

Keeps the localizations of the regions – ROIs, clusters, traces --

What it does

Keeps the localizations of the regions whose results pass a condition, and drops the rest from every layer, view and plugin: the nuclear pores with six corners or more, the MINFLUX traces whose spread is under 10 nm, the clusters of more than 20 localizations. The results are those the regions were measured with – by the per-region steps, Id statistics, a block of a chain – and stay in their region table; what reaches the localizations is one attribute, region_filter (1 in, 0 out), and a bound on it in every layer.

This is the step for a chain or a batch. By hand, the Regions tab's region filter section edits the same conditions, with the distribution of each value to set its range on, and the Render tab's regions button turns the filter off in one layer to see what it takes away.

The summaries – Histograms, Curves, Export table – then count the regions the filter keeps, as the views show them.

How it works

1. A condition is one value of one evaluation and a range – n_locs of Id statistics per cluster_id, from 20 up – or, for a keyword or a flag, the texts it accepts (an ROI's use, true). A missing value (not measured, NaN) fails.

2. A region passes if it passes every condition on its source – the ROIs, or the regions of one id attribute. Of two overlapping pores, one with the corners and the other with the diameter, neither passes.

3. A localization is kept if it is in any region that passes (an ROI overlapping a passing one does not take its localizations away), and in a passing region of every source that has conditions. A localization in no region of a filtered source – DBSCAN's noise once clusters are filtered, one outside every ROI – is dropped. The layers' own filters still apply on top.

4. A merged blink is kept if any of its localizations is.

In detail

The conditions are kept with the table, in its metadata, as the recipes of derived attributes are; a saved file opens filtered, and an undo brings back the table's own. The flag is written again from them whenever the table, the ROIs or their results change – never stored as a snapshot.

After a table change that keeps the regions' ids – a drift correction – the regions' results are out of date; the filter keeps applying them, and says so, as long as the id attribute is the one they were applied to (its hash is remembered). A new clustering leaves nothing to apply: that source's conditions are suspended, with a warning, until it is measured again. An ROI's values are its newest stored ones, current or not, as Filter ROIs reads them.

A region is always measured whatever the filter says: neither region_filter nor a value written from region results onto the localizations (Write results (to the localizations)) narrows a region's measurement, or counts among what its results depend on. Otherwise a filter on a result, applied while the result is measured again, would empty the regions that failed it, and the next run would drop them for good.

The filter is no undo step – it changes no localization – but it is logged, since what a later measurement saw depends on it.

Parameters

settingdefaultwhat it does
then
mode
add to the conditionsAdd this condition to the others (all must hold), replace them by it, or clear them all.

add keeps the conditions there are and adds this one, all of which must hold; replace leaves only this one; clear removes all, and needs nothing else.

Choices: add to the conditions; replace the conditions; clear every condition
results from
evaluation
choose...The evaluation, as the summaries name it; annotations: an ROI's use and keywords.

The evaluations offered are those the session has: the ROIs' by name, an id attribute's as "per cluster_id: ...", and annotations, an ROI's use, keywords and lines.

value
value
choose...The value of each region to test.
at least
low
autoEmpty: no lower bound.
at most
high
autoEmpty: no upper bound.
or one of
accept
–Texts to accept, separated by commas, for a keyword or a flag (true, false); replaces the range.

For a keyword list, the keywords to keep (good, unsure); for an ROI's use, true or false.

Output

The text gives each condition with how many regions it keeps of how many, and how many localizations are in regions that pass. A warning says when results are out of date, or a source's conditions are suspended.