Sort regions

Analysis › Regions · version 1

Orders the ROI manager's list of ROIs by what was measured in them or

What it does

Puts the ROIs (regions of interest: shapes kept in the ROI manager, inside which things are measured) in order of something measured in them – the number of corners of a nuclear pore, the localizations in a cluster – or of a keyword they were given in the ROI manager (annotate). The ROI manager's list, the results table and every summary that reads it, such as Histograms, then go through the ROIs in that order. Use it to look at the best or the worst sites first, or to step through them in the ROI manager grouped by a keyword.

It changes the order only. Each ROI keeps its number, its results and whether it is used; Filter ROIs is the plugin that includes and excludes.

How it works

What it reads. For each ROI, the newest stored values of every measurement made in it – whatever ran it: the per-region steps, a chain or a script – named as in the results table, its keywords, one column per list, and the angle and length of each line drawn on it (<line>_angle_deg, <line>_length_nm). Its centre is there too, as roi_x_nm and roi_y_nm, to walk through the ROIs from left to right. A result that is out of date still counts, so the order does not change under the user while the ROIs are measured again.

The order. ROIs are ordered by sort by, those with equal values by then by, then by and then by, and finally by their number. The form shows sort by alone at first; then by appears once sort by is chosen, and and then by once then by is. A key after one left at none is not used. A keyword sorts by its place in its list: with quality: good, bad, unsure, good comes first, then bad, then unsure (largest first reverses that). An ROI with no value – not measured, the step failed, no keyword – goes to the end either way.

Where it shows. The order is kept with the ROIs, saved in the file, and used by the ROI manager's list (so Up and Down step through it) and by the results table. ROIs added later come after the sorted ones. Clicking a column of the ROI manager's list sorts by that column too, and clicking ROI returns to the order of the numbers, as does running this with sort by set to none.

Parameters

settingdefaultwhat it does
sort by
by
noneA measured column or a keyword list; none: by ROI number.

The lists offer every column some ROI has a value for, and every keyword list. A column two steps both write is named step.column.

largest first
descending
onDescending: the largest value, or a list's last keyword, first.

For a count or a score, ticked puts the largest first; for a keyword list, the last keyword of the list first.

then by
then_by
noneBreaks the ties of the first.

Useful when the first column takes few values, such as a count of corners: the ROIs with the same count are then ordered by this.

largest first
then_descending
on

As largest first above, for then by.

and then by
last_by
noneBreaks the ties of the first two.

Rarely needed; ties that remain after it are ordered by ROI number.

largest first
last_descending
on

As largest first above, for and then by.

Output

The line under the panel says how many ROIs were sorted, by what, and how many had no value for the first column and went to the end. Nothing is drawn; the ROI manager's list shows the new order.

Differences from SMAP

Ported from SMAP's SortROIs (Ries 2020).

References