Analysis › Regions · version 1
Writes what was measured per region somewhere it is used: onto the
Takes what was measured once per region and writes it where it is used next. write to chooses where:
Both read the same results – what the per-region steps, a block of a chain or a segmenter measured – and measure nothing themselves. What a step proposed for its ROI is set with Apply proposals in the Regions tab, or Apply proposals to ROIs in a chain.
Takes what was measured once per region – in each ROI (region of interest, a shape in the ROI manager), or in each cluster an id attribute such as cluster_id names – and writes it onto the localizations of that region, as an attribute of the table. Every localization in a pore gets the pore's number of corners; every localization in a cluster gets that cluster's size or precision.
The point is that an attribute is something every other tool already reads. With the region's result on its localizations
It can also write each ROI's own number, as the ROI manager shows it (roi_id): the ROIs then live in the table itself, and a block set to for each roi_id repeats over them like over clusters. An ROI's number is given when the ROI is made and kept when others are removed, and the results' rows name the ROI by the same number, so ROI 5 in the list, in the attribute and in the results is the same ROI.
What you said of the ROIs reaches the table the same way. Only ROIs ticked use are written, so a roi_id of 0 or above is "in a used ROI" (-1 is none): a filter on it keeps the tracks or sites you kept and drops the rest, for any plugin that runs on the view afterwards. An ROI's ranges (set under ranges in the ROI manager's annotate: frames, z or any attribute) are part of what it holds, so a localization outside them gets -1 too. And each list of keywords becomes an attribute, <list>_keyword, holding the keyword's place in its list – with the lists quality: good, bad, quality_keyword is 1 on the localizations of the ROIs called good and 2 on the bad ones. With nothing in results from and values, the plugin writes roi_id and every keyword attribute some used ROI has.
The results must be there first: the ROIs measured (by the per-region steps, or a block of a chain – plugins run one after another as one – over the ROIs), or a block over an id attribute such as cluster_id. A block of a chain can write the same attributes itself at the end of its run – its write values field – which keeps them up to date whenever the chain runs; this plugin is for results that are already there, and the way to do it after the per-region steps, which do not offer write values.
It is a snapshot. Moving an ROI, re-clustering, or measuring again does not change the attribute; run it again (or let the block write it) to bring it up to date. The run is written into the table's history.
Writes what was measured in each ROI (region of interest: a shape, or a track, kept in the ROI manager) onto the ROI itself: as its angle, a range of any attribute (frames, z, time, ...), a named line, a keyword, or its centre.
Some measurements say more than a number in a table. The direction a motor's track moved is the frame its steps should be measured in; the frame where a molecule stops settling is where its analysis should start; a fitted axis is a line worth seeing on the structure; "elongated" is a category to sort and compare by. This plugin turns such a value into the ROI's own property, so the next measurement uses it, the ROI manager shows it, and the summaries group by it.
It measures nothing itself. Each target reads columns of what the ROIs' steps, or the segmenter that made them, measured – any plugin that writes the value, a user's own too, can be the source. For a motor's direction, for example, the Trace inspector, run in each ROI, measures angle_deg, and Segment regions from an id attribute measures it while it makes the ROIs.
What was set by hand in the ROI manager is worth more than a value measured again, so by default it is left alone: new ROIs can be given theirs without undoing corrections.
Write to. Only the chosen destination's settings are shown, and only they are read.
Which localizations. A region holds the localizations inside its outline – whatever the layers' filters – or, for an id attribute, the rows with its id: membership is the region alone, as when a block runs. An ROI of an id alone (a track) holds that id's localizations, and an ROI's frame range and z range narrow what it holds. Only the ROIs ticked use are written.
The values. Each region's number is written over its rows. A localization in no region, or in a region with no result (the measurement failed there, or the region came after it), gets no value (NaN): a filter on the attribute drops it. The ROI number is 0 outside every ROI.
Overlaps. Where two ROIs overlap, a localization takes the later ROI's value – the one made after the other – or, with overlaps, the first's or the mean of both. The regions of an id attribute never overlap. A block's write values writes by the same rules, the block's own overlaps; its fourth choice, any, is for a flag the block writes back and is refused for written values.
Merged blinks. The attributes are kept when blinks are merged – merge blinks, also called grouping or linking, combines the localizations in consecutive frames that come from one blinking event into one: a blink takes the mean of its localizations' values (all the same unless the blink crosses two regions), and the highest ROI number.
Measure first. Run the steps that measure the value in the ROIs, or make the ROIs with a segmenter that measures it. Its columns are then the choices of each target's fields.
Choose the target. set picks one; only its part of the form is shown.
x_site_nm), and the ROI manager's rotate shows it so.Write it. The ROIs selected in the ROI manager's list – all of them when none is, and always all in a chain or a batch – are the ones it changes: use is for the analysis, what is changed is chosen by selecting. Each ROI it may change gets the value of its row. An ROI with no value in a column the target reads is left as it is. All of it is one step of the ROI manager's undo.
Which table. The localizations, whatever the layer shows: the values are written onto every localization of a region, and the merged blinks take them when they are merged again (Merged blinks, above).
What may be written over. The table remembers which attributes were written from regions (metadata["region_columns"], with where each came from). Running again writes over those, but never over an attribute the localizations had of their own: a value named like one (photons, say) is refused, and prefix gives it another name.
Which ROI results. For the ROIs, the values are those of the results that still describe each ROI as it is now – the same rows the analyses read – so an ROI moved since it was measured gets no value until it is measured again.
Who set what. Every ROI keeps who set each of its properties (ROI.set_by): hand for one set in the ROI manager – the angle turned, a range typed or dragged, a line drawn, a keyword given – or the name of the method that set it, this plugin's, a segmenter's, Centre ROIs'. Each target is its own property: angle, range:<attribute>, line:<name> and keyword:<list> per attribute, name and list; so a line drawn by hand does not protect the angle. change reads it. The centre is never protected: an ROI centred by a click is placed by eye, roughly, and a measured centre always replaces it. An angle loaded from a file that kept no such note, SMAP's rotation line among them, counts as set by hand.
Directions are degrees anticlockwise from in the file's coordinates,
, the convention of the ROI manager's lines and of
angle_deg in the tracking plugins, and an angle is kept between ° and
°. An axis that has no direction – an ellipse's long axis, between 0° and 180° – is taken as it is: which end is on the left is then arbitrary.
Whole numbers. On frame, tid or an attribute ending _id, the ends are rounded to whole numbers. A range whose high end comes before its low end is not set. A column must be in the attribute's own units: a time in seconds is not turned into frames – set the range on time_s instead.
What goes out of date. An angle, a range, a line or a centre is part of what the ROI's results were measured in, so the ROIs whose value changed are measured again by the per-region steps; the text says so. A keyword is a note, and nothing is measured again.
A new line name joins the project's line names, so the ROI manager's Line button offers it.
| setting | default | what it does |
|---|---|---|
write toto | the localizations, as attributes | Onto the localizations of each region, as attributes to filter or colour by; or onto each ROI, as its angle, a range, a line, a keyword or its centre. the localizations changes the table, and is undone with it; the ROIs is one step of the ROI manager's undo and changes no localization. The ROIs can only take results measured in them: for the regions of an id attribute, write to the localizations. Choices: the localizations, as attributes; the ROIs, as their properties |
| to the localizations | ||
results fromlocalizations.source | auto | What was measured on the ROIs, or per region of an id attribute; empty: the ROIs, for their numbers. Lists every current set of results on the ROIs by its step's name, then every current set for an id attribute's regions as per cluster_id: .... Left empty it writes only the ROIs' numbers. Results that no longer describe their regions – re-clustered, the table or a filter changed – are refused with a message saying so; an attribute written by this plugin is not such a change, so a second value can be written from the same results. |
valueslocalizations.values | – | Comma separated; empty: every number the measurement has (no measurement: roi_id and the keywords); roi_id: the ROI's number; <line>_angle_deg, <line>_length_nm: its lines; <list>_keyword: its keyword's number. The names are those of the results' columns, as Summarize/Histograms shows them. The lines drawn on the ROIs in the ROI manager give |
prefix (more)localizations.prefix | – | Put before each attribute's name. Needed when a value has a name the table already uses, and useful to keep two snapshots side by side: |
overlaps (more)localizations.merge | last | A localization in two ROIs takes the later ROI's value, the first's, or their mean. Only matters where ROIs overlap. mean suits a value measured over both; last keeps the newer ROI's, as drawn. Choices: last; first; mean |
| to the ROIs | ||
setrois.target | angle | Which property of the ROIs is set from the results. Only one target per run: in a chain, one step per target. Choices: angle; a range; a line; a keyword; centre |
| angle | ||
angle fromrois.angle.column | none | A measured column in degrees, anticlockwise from +x: the Trace inspector's or Segment regions' angle_deg, say. |
| a range | ||
attributerois.range.attribute | frame | The attribute the range is on: frame, z_nm, time_s, ... |
fromrois.range.mode | a low and a high column | The range's two ends, or a centre plus and minus k widths. Choices: a low and a high column; a centre and a width |
lowrois.range.low | open | A measured column with the range's low end; open: from the start. For a track's tail, the frame (or the time) its analysis starts at. A value just measured in the ROI was measured with its old range; measuring again with the new one can move it. |
highrois.range.high | open | The high end; open: to the end. |
centrerois.range.centre | none | The middle. |
widthrois.range.width | none | A spread, such as a standard deviation. |
krois.range.k | 2 | Widths on either side. 2 takes in about 95 % of a Gaussian spread, 3 nearly all of it. |
| a line | ||
linerois.line.name | line | The line's name; a new name joins the project's line names. |
fromrois.line.mode | a centre, an angle and a length | As the tracking plugins measure an axis, or two points. a centre, an angle and a length is how the tracking plugins describe a track's axis; its two ends fits a measurement that reports two points. Choices: a centre, an angle and a length; its two ends |
centre xrois.line.x | none | Nm. |
centre yrois.line.y | none | Nm. |
anglerois.line.angle | none | Degrees, anticlockwise from +x; the line points that way. |
lengthrois.line.length | none | Nm. |
start xrois.line.x0 | none | Nm. |
start yrois.line.y0 | none | Nm. |
end xrois.line.x1 | none | Nm. |
end yrois.line.y1 | none | Nm. |
| a keyword | ||
listrois.keyword.list_name | none | The keyword list (the ROI manager's lists). |
whererois.keyword.condition | – | A condition on the measured columns, as Filter ROIs writes it: eccentricity > 4. Every name in it must be a measured column; one no ROI has is refused, as in Filter ROIs, since it is nearly always a typing error. |
keywordrois.keyword.keyword | none | Given where the condition holds. |
otherwiserois.keyword.otherwise | none | Where it does not: another keyword, none, or left as it is. leave it changes only the ROIs the condition holds for; none clears the keyword elsewhere. |
| centre | ||
xrois.centre.x | none | The centre's x, nm. |
yrois.centre.y | none | The centre's y, nm. |
changerois.which | all but those set by hand | Which of the ROIs selected in the ROI manager (all, when none is) get the measured value. all but those set by hand is the usual choice, and the one to run again after adding ROIs. only those not set yet also keeps what an earlier run or a segmenter set. all, those set by hand too starts over – one undo step takes it back. Choices: all but those set by hand; only those not set yet; all, those set by hand too |
To the localizations. The table with the new attributes; the text names them and says over how many regions and localizations they were written, and how many localizations are in none.
A histogram of such an attribute in the filter counts localizations, not regions: a large cluster weighs more than a small one. For the distribution over regions, use Summarize/Histograms on the same results.
To the ROIs. The ROIs' new properties, and a line saying how many were set, how many changed, and how many were passed over and why: set by hand, already set, not used, nothing measured, or (for a keyword) left as they were.