Filter ROIs

Analysis › Regions · version 1

Includes or excludes ROIs by a condition on what was measured in them

What it does

Includes or excludes ROIs (regions of interest: shapes kept in the ROI manager, inside which things are measured) by a condition on what was measured in them and the keywords they were given in the ROI manager (annotate): keep the nuclear pores with six corners or more, the clusters of more than 50 localizations, the sites annotated good, the sites inside a cell drawn around in the render window. It sets each ROI's use, which is what the per-region steps, the results table and the summaries respect. Use it in place of excluding ROIs one by one, and in a chain, after the ROIs were measured.

How it works

The condition. A line such as

n_corners >= 6 and quality == "good"

Names are the results table's columns and the keyword lists; a keyword is written in quotes and compared as text. Comparisons (==, !=, <, <=, >, >=, also chained, 2 < n < 9), and, or, not, arithmetic and in ["good", "unsure"] are understood; nothing else is. A column whose name has spaces in it – NPC Corners.n_corners, when two steps write n_corners – is written in backquotes.

What it reads. For each ROI, the newest stored values of every measurement made in it, current or not, its keywords, and the angle and length of each line drawn on it (direction_angle_deg, direction_length_nm), as Sort regions reads them – and where it is:

unmeasured ROI is left out by n_corners >= 6. A name no ROI has is refused, since it is nearly always a typing error that would exclude everything.

Before it runs. Under the panel, as the condition is typed, how many ROIs it would use, and how many are used now.

Running it sets use on every ROI, as one step of the ROI manager's undo (Undo). An ROI keeps its number and its results either way.

Parameters

settingdefaultwhat it does
keep
condition
–Which ROIs to use, e.g. n_corners >= 6 and quality == "good".

Start from one column and check the count under the panel before adding more.

insert
insert
noneA measured column or keyword list, added to the end of the condition.

The names to write in the condition, without typing them: the list has every column some ROI has a value for, and the keyword lists. The name is added at the end of the condition, in backquotes where it needs them; type the comparison after it.

then
mode
exclude the othersExclude the ROIs that fail, leaving those already excluded so; or include every ROI that passes too.

exclude the others only ever excludes: a filter run after another narrows the set further, and an ROI excluded by hand stays excluded. use exactly these also includes every ROI that passes, undoing earlier exclusions – SMAP's behaviour.

Choices: exclude the others; use exactly these

Output

The line under the panel says how many ROIs are used and how many changed. Excluded ROIs turn grey in the ROI manager and drop out of the results.

Differences from SMAP

Ported from SMAP's FilterSites (Ries 2020).

References