Analysis › Regions · version 4 · has a preview
Finds regions and makes ROIs of them: rings or discs by a circle
Puts an ROI (region of interest: a shape kept in the ROI manager, inside which things are measured) on every structure of a kind – every nuclear pore, every clathrin-coated pit, every bead, every cluster – so that the structures can be measured one by one, reviewed and annotated. It is the first of the ROI manager's three steps:
How the structures are found is the method, a model of the structure; the form shows only the chosen method's settings:
The circle template, beads and like examples measure every candidate they find – its radius, how round it is, how many localizations it has, and what its model adds – and keep decides which candidates become ROIs: one condition on those values, written as in Filter ROIs, such as n_ring >= 4 and 40 <= radius_nm <= 70. The values stay with each ROI and are columns of the ROI manager's results table, so the ROIs can later be sorted and filtered by them like anything measured.
A preset fills the settings for one kind of structure, keep included:
pair_id; on one colour, every trace, tid) with 20 localizations as an ROI, drawn as its track and turned along it; those that walk – 100 nm, linearity of 0.8 or more – used, the others added unused (keep rejected); tick only in both colours for the molecules seen in both.Without a preset, the settings are discs of 30 to 150 nm with at least 10 localizations: compact structures of any kind, as a first look.
A preset is a small text file of settings; a lab adds its own structure as a file under segment_presets in smappy's configuration folder, and it appears in the list (one of the same name replaces the shipped one). The settings, not the preset, are what a run uses; change any after choosing one.
Preview draws the ROIs it would make, grey, in the ROI manager without adding them; Run adds them, as one step of the ROI manager's Undo – or the ROI manager's Add previewed ROIs adds those shown, without searching again.
Nuclear pores. Nuclear pore complexes (NPCs) are rings of eight corners, about 110 nm across, in the flat nuclear envelope. Imaged at a pore protein such as Nup96, they are the reference structure of quantitative SMLM (Thevathasan et al. 2019, doi:10.1038/s41592-019-0574-9): the labelling efficiency (also called degree of labelling: the fraction of target proteins that carry a detected label), the resolution and the scale of a microscope can all be measured on them. For that, each pore needs its own ROI, centred on the pore, which is what NPC Corners and NPC labelling efficiency read. The NPC preset looks for rings of the pore's radius, fits a circle to every candidate, and keeps those that look like a ring: enough localizations on it, the right radius, and few localizations far from it.
The checks are made to keep sparse pores. A pore with only a few corners labelled is still a pore, and those pores are what the labelling efficiency is measured from; what has to go is what is not a ring at all – blobs, filled clumps, pieces of filament. Use it on a 2D view of the nuclear envelope at the bottom of the nucleus, where the pores are seen face on, with blinks merged (one localization per blink) – merge blinks, also called grouping or linking, combines the localizations in consecutive frames that come from one blinking event into one.
Pits and other filled structures. With shape set to disc, the template is a filled disc: clathrin-coated pits, small clusters, anything compact and roundish. Over a range of radii it finds each structure at its own size, and measures that size. centre_ratio says whether a disc is filled evenly (about 1) or empty in the middle (near 0): a pit late in its growth, which looks like a ring, has a low one – a value to sort or filter on, not a second class.
Touching structures are flagged (touching is 1) and not split; a keep with touching == 0 leaves them out.
Fiducial beads – fluorescent beads on the coverslip – are bright and seen in nearly every frame, which makes them the reference for drift and for the stability of the microscope. The beads method finds them as bright, long tracks, with the same linker as Fiducials drift correction, and puts an ROI on each. Fiducials with markers from set to ROI manager then takes each used ROI as a bead, and Stability runs once per ROI – so the beads can be looked at, excluded or annotated before either.
Makes an ROI for every region an id attribute of the table names – usually every cluster (localizations lying closer to each other than to the rest) a clusterer found (cluster_id, from Find clusters or any other) – so the clusters can be looked at one by one, reviewed, excluded and annotated.
It works on any attribute of whole numbers: an id of -1 means "in no region" and gets no ROI, and so does an id with fewer than at least localizations. Use it when the clusters need a person's eye or a note; to measure every cluster, a block of a chain (plugins run one after another as one) repeating over cluster_id does it without ROIs, and is much faster for thousands of clusters.
It is also how tracks are explored. With an ROI holds set to its id alone and the attribute track_id (from Link tracks), each track becomes an ROI that holds that track's localizations and nothing else – not the other tracks that cross its path, which any shape drawn round it would take in. The ROI manager draws it as its line, selects it by a click on the line, and lists it beside the other ROIs, with use, keywords, and ranges of its own (frames, z, or any attribute).
For motors – kinesin on a microtubule, a MINFLUX tid that walks – the tracks that move one way can be picked out from those that diffuse, and each turned so that it runs along , left to right in time. keep of this method measures every id as a trace (its length, how elongated it is, which way it went) and makes ROIs only of those it keeps:
eccentricity >= 4 and displacement_nm >= 300 keeps long straight runs. linearity – the squared correlation of the position along the track with time – tells a motor that walks on (near 1) from one stuck or diffusing to and fro along its microtubule (near 0), which is as elongated; velocity_nm_per_s is the displacement over the duration, and n_colours the colours an id holds, 2 for a molecule seen in both. angle gives each ROI the direction its trace moved, as its own frame, so every step measured in it, such as Find steps, gets positions along the track (x_site_nm). Both are off by default: for diffusing molecules, or clusters, a direction means nothing.
Puts an ROI at each position of a table: a csv or tsv with x_nm and y_nm, and optionally the file each position belongs to. The ROIs get the ROI manager's size and shape. Use it to bring back the sites of an earlier analysis – Export table with ROI position ticked writes such a table – or sites chosen in another program.
Segmentation by example, for a structure that none of the models above describes: put ROIs on five or ten good ones in the ROI manager – clicked at its ROI size, or drawn as free shapes – and the method puts an ROI on every other structure of the file that looks like them. The examples are the used ROIs, by default; examples can make them all ROIs, or those with a keyword, for a project that holds other ROIs too. "Looks like" is a few numbers measured on what each ROI holds: by default how many localizations it has (n_locs) and how spread out they are (rmsd_nm). A candidate is kept when its numbers lie within the examples' mean plus or minus spread standard deviations.
There is nothing to tune but the examples. Choose them as varied as the structures you want – a faint one and a bright one – since the window can only be as wide as they are. It works best for compact structures of one kind, well apart; structures that touch, or whose number of localizations varies a lot over the field, are found less reliably. The window it learned is shown in the text and joined to keep, so it can be read, and narrowed with conditions of your own.
1. A density image. The localizations are binned into an image with pixels of bin (10 nm). Its square root is taken, so that one molecule that blinks many times in one place does not outweigh a whole structure.
2. A template at each radius. The image is filtered with the shape's template. The ring is a ring of the radius, minus a disc of the same total weight; the disc is a filled disc, minus the ring-shaped band around it, of the same weight. At each position the filter gives the localizations on the shape minus what the surround says is background: an empty area gives zero, and so does an evenly covered one, while a structure of the template's shape gives a strong peak at its centre. With min radius and max radius different, this is done at several radii, each about 15 % (or a ring width) larger than the last.
3. The best radius. At each position the radius that matches best wins – the one with the best signal against the background's noise – and it is the structure's first size estimate.
4. Candidates. The peaks of the filtered image are candidates, taken strongest first. A candidate whose circle overlaps a stronger one's by more than half the smaller radius is dropped: two pores of 55 nm may be as close as 82.5 nm, and then they touch.
5. Measuring each candidate. Each candidate is measured on its localizations within about 1.5 times its radius (for a ring, as far as its template reaches). A ring's centre is placed by fitting a circle of the template's radius to the localizations better than judge on precision (20 nm) – the localization precision, also called the CRLB, how far a fitted position is expected to lie from the true one; a disc's is the mean position of its localizations. Then its values: the radius (for a ring, a circle fitted with its radius free; for a disc, from how far its localizations lie from the centre), how round it is, how many localizations it has, and its shape's own values – for a ring how many lie on it, inside it and outside it, and whether too many lie far from it for their precision; for a disc how dense its centre is against its edge. Candidates are measured strongest first, and each one kept claims its localizations: a weaker candidate is measured only on what is left, so the arc of a pore that the window of a candidate beside it takes in is not a ring of its own.
6. Keep. keep is checked on every candidate's values; those that pass become ROIs. A candidate that overlaps one that passes is marked touching.

A 2 µm piece of a simulated nuclear envelope (Nup96, 60 % labelling), with the NPC preset. Left: the localizations. Middle: the ring-filtered density, bright at the centre of every pore. Right: the pores kept, each with its fitted circle, and the true centres (+).

What the NPC preset's keep sees, on made-up structures with a precision of 5 nm: the fitted circle (blue), the localizations more than 3 precisions from it (red), and the verdict – the clauses of keep a candidate fails. A full pore passes, and so does a sparse one with three corners. A single blob fits a small circle. A filled disc fails on its far localizations, whether the centre is on it or beside it – where the ring filter often puts it.

Filled discs of 30 to 150 nm radius (8 nm precision, scattered background), found with shape disc between 30 and 150 nm. Left: the localizations and the discs found, each drawn at its measured radius. Right: the measured radius against the true one, within 15 % (dashed) of it.
1. Bright localizations. Only localizations of at least min photons can be a bead.
2. Tracks. They are linked into tracks frame to frame, a step being at most maximum jump and a track allowed to miss up to memory frames – the linker of Link tracks.
3. Long ones. A track seen in at least min length of the frames is a bead.
4. The ROI. Each bead gets an ROI at the median position of its localizations, at the ROI manager's size and shape, and is measured: the fraction of the frames it was seen in (frames_fraction), its median photons, and the spread of its positions (spread_nm), which includes the drift. keep then decides, as for the circle template.
The regions. The localizations are sorted by their id; each id above 0 with enough localizations is one region. attribute on auto takes the first the table has of pair_id (a two-colour MINFLUX molecule), tid (a MINFLUX trace), track_id and cluster_id. Membership is the attribute alone: the layers' filters do not decide which localizations a cluster has.
The outline. With the cluster's own outline ticked (the default), the ROI is the convex hull of the cluster's positions – the smallest shape with no dents that holds them all – so it fits a cluster of any shape and size. A localization exactly on the hull's edge or at a corner counts as inside. Unticked, only the cluster's centre is placed, and the ROI is the circle or square of the Regions tab, at its size: the right choice when the clusters are alike (pores, say) and every ROI should be measured in the same window. Such ROIs follow the Regions tab's shape and size when they are changed later, and Clear shape (the ROI manager's Polygon menu) turns a hull ROI into one. A cluster whose localizations all lie on one line has no hull; it gets the centre and the Regions tab's shape even with the outline ticked, and the text says how many did.
Its id alone. With an ROI holds set to its id alone, the ROI has no shape: it holds the localizations with its id, wherever they are, and the outline settings do not apply. The ROI manager draws it from its localizations – with draw it as a track, a line through them in frame order; as an outline, the hull round them. On auto an attribute whose name contains track (or MINFLUX's tid) is drawn as tracks and any other as outlines. Drawing a polygon on such an ROI in the ROI manager makes it the part of its id inside the polygon; Clear shape makes it the whole id again.
Each id as a trace. When keep or angle is set, every id's localizations are measured in time order (time_s, else the frame) by the same functions as Trace statistics: n_locs; displacement_nm, first to last; the spread along the long and the short axis of their positions (std_long_nm, std_short_nm), their ratio eccentricity, and trend_nm, the short axis' spread beyond the scatter between neighbours; and two directions, angle_deg, the long axis pointing from the trace's first quarter to its last, and ends_angle_deg, from its first localization to its last. keep is tested on these, and an id that fails it gets no ROI – or, with keep rejected, one that is not used; the text counts them, by the clause they failed. With only in both colours an id must also hold localizations of both colours (n_colours, below). Three more values are there for motors: velocity_nm_per_s, the displacement over the duration; linearity, the squared correlation of the position along the long axis with time; and n_colours.
Two colours. In a table of two colours (channel, else thi) every ROI is annotated in the keyword list colours: dual where its id holds localizations of both colours, single where it holds one. The list is made where it is missing, with a third word, apart: a molecule in both colours that does not move as one, which Find steps proposes. The ROI manager filters and sorts by it, as by any keyword. The values are kept with each ROI and are columns of the results table, as the other methods' are.
The angle. long axis, forward in time gives each ROI angle_deg: the axis is fitted to all the localizations, so the jitter of single steps hardly moves it, and the first and last quarter only decide which way it points. A motor that sits still for part of its trace pulls it somewhat; Find steps run in the ROI proposes the direction from the parts where it moves. first to last localization gives ends_angle_deg, which is noisier but follows a track that curves. A track that goes out and comes back has no clear direction either way; turn such an ROI by hand in the ROI manager, and Write results run later leaves it alone.
The ROI. Its centre is the mean position of the cluster's localizations, its file the one its localizations came from, and it remembers the attribute, the id and the number of localizations (origin). All the ROIs of a run are one step of the ROI manager's undo.
The table. The columns for x and y are found by their headers as the csv loader finds them, in nm unless the header says otherwise.
The file. A position goes to the file its row names, by file_id (as Export table writes it, for the same session), file (the file's name) or filenumber; without any of these, to the file the ROI manager shows.
1. The examples. The used ROIs of every file (or all of them, or those with the keyword, as examples says), leaving out the ones this method made. Each is measured on all the localizations it holds, whatever its shape: the number, and how far they lie from their centre.
2. The window. For each value in compare, the examples' mean plus or minus spread standard deviations. It becomes a condition – for example 23.2 <= n_locs <= 46.8 and 26.7 <= rmsd_nm <= 35.9 – that is joined to keep.
3. Circles everywhere, moved onto the structures. ROIs of the ROI manager's shape and size – circles or squares – are laid over the whole file on a triangular grid, half an ROI size apart, and those with fewer than 3 localizations are dropped. Each circle is moved to the centre of the localizations inside it, again and again, until it stops: it climbs onto the nearest structure, so many circles end up on each one.
4. One candidate per structure. The candidates are sorted by how close their values are to the middle of the window, and one overlapping a better one – or an ROI already in the file, the examples among them – by more than half a radius is dropped.
5. Keep. The window and keep are checked on every candidate, as for the circle template.

A simulated field of discs of 40 nm (40 localizations each) beside large and small blobs and background, segmented like five example ROIs (orange). Left: the discs found (blue) and the candidates rejected (grey). Right: every candidate's values, the examples (orange) and the window learned from them (red): the discs fall inside it, the large blobs above and the small ones below.
The templates. With the bin,
the radius and
the ring width, the ring's template is
on a grid of pixels of size reaching to
, with
one where the condition holds and zero elsewhere. The disc's is
a disc minus the band out to , which has the same area. Both sum to zero. They are applied by an FFT convolution to
,
the localizations per pixel, which where a pixel holds one localization at most – nearly everywhere at 10 nm – is
itself. The disc's response is then the localizations inside it less those in its band; the ring's, whose surround is a disc that takes in the ring too, is the localizations on the ring less the disc's mean density times the ring's weight, about 0.4 of the localizations on the ring at the pore's size. The image covers the localizations with a margin of the largest template and may have at most 16 million pixels (80 µm by 80 µm at 20 nm); a larger one is refused with a request to increase the bin.
The radii and the best one. From min radius, each radius is the last plus the larger of 15 % of it and, for a ring, the ring width, up to max radius. At each pixel the radius with the largest wins,
the sum of the template's positive part – the signal against the Poisson noise of a background over the same area. The response alone would not do for a disc: once the template holds the whole disc, every larger radius answers the same count.
Candidates. A pixel is a candidate when it is the largest score within a square about min radius wide and its response is above zero. Taken by score, a candidate is dropped when its circle – of its template radius – and a stronger one's overlap by more than half the smaller radius,
checked at the filter's maximum and again where its fit moved it. An ROI already in the file counts as a circle of the candidate's own radius. A candidate needs 3 localizations of its own in its window, the fewest a circle is fitted to.
Claimed localizations. Each candidate claims its localizations – a ring those out to from its centre, as far as the filter's disc reaches, a disc those inside its measured radius – whether keep passes it or not. Every weaker candidate is fitted and counted only on the localizations not claimed (a ring's far test still sees all of its window); one with fewer than 3 left is dropped. An ROI already in the file claims what a candidate of min radius would. Without this, a candidate about 100 nm beside a pore, its window taking in an arc of the pore, passed the NPC checks next to 6 of 141 simulated pores, and at 500 photons, where a pore's localizations spread far past its band, next to a third of them.
A ring's values. The window is , as far as the template reaches – 100 nm for a pore: a sparse pore found 50 nm off its centre, as happens at 500 photons, fails the far test only when the window takes in the far side of the pore. With these rules the NPC preset finds what the ring template it replaced found: on the simulations of
studies/npc_le with junk, over 18 conditions of labelling, photons and blinks, the pores found and the junk kept were within 1 % and 2 % of its, and the fitted labelling efficiency within 0.017. The centre is fitted twice with the radius fixed at , the second time on the window around the first answer; the fits minimise
,
the distance of localization
from the centre, with the soft-L1 loss
: a localization far from the circle counts with its distance, not its square. They are minimised by Gauss-Newton with reweighting, up to 30 iterations, on the localizations better than judge on precision; when fewer than 3 are, or the table has no precision attribute, on all of them.
radius_nm is the same fit with the radius free. n_ring, n_inside and n_outside count every localization in the window in the band , nearer the centre, and further out.
The far test (far_p). With the fitted radius and
the precision (
xy_err_nm) of each of the precise localizations,
= 5 nm for the tilt of the pore and the size of the label. A localization is far when
, which on a pore happens 0.3 % of the time. With
far ones,
for
binomial with
trials and a chance of 1 %. Two things follow. The test is the same at 500 photons as at 5000, because each localization is judged by its own precision; and it needs nothing about how often a fluorophore blinks. Without a precision attribute it is 1. Two touching pores fail it: each sees the other's localizations in its window, far from its own ring.
Why not the fractions inside and outside as the checks. Counted on every localization, as SMAP's clean-up does, those fractions do not tell a pore from a clump at low photon numbers: a pore's imprecise localizations land inside and outside too. And a filled clump the size of a pore passes them, because the ring filter answers a filled disc with a ring of response around it, so the centre lands beside the clump, and from there the clump is an arc of the right radius with nothing inside. On simulations with pore-sized clumps among the pores, the far test kept the clumps that reached the analysis to 3 to 5 per 300 pores at 5000 photons (16 to 19 with the fractions); see studies/npc_le. n_inside and n_outside are there to look at all the same.
Why n_ring >= 4. Every localization in the band counts, precise or not. A pore that shows corners has at least
of them, so with the analysis fitted from 5 corners, any value up to 5 loses no pore the analysis uses; 4 removes most of the background. A higher value removes the sparse pores that still show 5 corners: 10 found 27 % of the pores showing 4 corners in the simulations of
studies/npc_le, and 14 % with one blink per fluorophore at 500 photons.
A disc's values. The window is . The centre is the mean position of the localizations in the window, taken twice, the second time around the first. With
the distances from it of the precise localizations in the window,
the radius of a uniform disc with that spread, less the localizations' own (; nothing without a precision attribute). It is taken three times, the last two over the localizations within
(or
without a precision): one background localization at the window's edge, counting with its distance squared, made a 30 nm disc 16 % too large. On the simulated discs above the radius is within 15 % from 30 to 150 nm.
centre_ratio is the density within over the density between
and
: three times the ratio of the counts, as the inner circle is a quarter of the area.
The shared values. n_locs is the localizations in the window that no stronger candidate claimed. roundness is , the square roots of the eigenvalues of the covariance of the precise localizations in the window – as Cluster shape computes them: 1 for a round structure,
for an ellipse of half-axes
and
. A ring's own window takes in some background, which makes it read a little rounder than it is.
psf_nm is the mean sigma_nm in the window – SMAP's check that a structure is in focus – and NaN without that attribute. touching is 1 when the candidate's circle (of radius_nm, or of the template's radius when that is not a number) overlaps at all the circle of another candidate that passes keep – keep taken first with every touching 0. The rejected candidates are not counted: most are background, beside every structure, and would flag them all.
What it runs on. In the ROI manager, the file being shown, on its localizations after the layer's filters (the lowest and highest values of attributes, set in the Render tab) – so a z or frame range set there limits the search – and on the merged blinks when the layer merges them. The ROIs get the manager's size and shape (a circle of 300 nm by default).
keep is read by the parser of Filter ROIs, never run as code: comparisons (chained too, 40 <= radius_nm <= 70), and, or, not, arithmetic, numbers and in [...]. A value that is not a number (NaN, as radius_nm is with fewer than 3 precise localizations) makes every comparison with it false. A name the method does not measure is an error naming those it does, and so is psf_nm on a table without sigma_nm: a condition on a value that is not there would otherwise reject, or keep, every candidate silently. An empty keep keeps every candidate. A rejected candidate lists the parts of keep joined by its top-level and that it fails.
The tracks are find_beads of Fiducials: the localizations of at least min photons, linked frame to frame by the greedy linker, kept when seen in at least the min length fraction of the frames – the last frame plus one, or the file's frame count when it records one. A bead within three times its spread of an ROI already in the file is that ROI's, and not proposed again.
Which table. The localizations of the file shown, under the layer's filter. Beads are tracks of single localizations, so a layer that merges blinks is refused: a bead seen in every frame would be one merged blink.
The values. frames_fraction is the number of different frames the bead was seen in over all frames; photons the median; spread_nm is , drift included;
radius_nm about the median position, as a disc's;
n_locs its localizations; roundness and psf_nm as above.
Which table. The localizations, whatever the layer shows: the id attribute is theirs, and a region's outline is drawn round all of its localizations.
An ROI of its id alone keeps {column: id} (ROI.ids) with its shape switched off (ROI.spatial). Its rows are found through one sort of the attribute, kept while the attribute is unchanged, so thousands of such ROIs cost a binary search each rather than a pass over the table. On a layer that merges blinks, it holds the blinks its localizations belong to, through group_id.
The columns are the csv loader's: a header x, xnm or x_nm in any case for x and the same for y, the separator – comma, semicolon or tab – found from the header line, and a unit in brackets (x [um]) in nm, um or mm, nm when none is given; pixels are refused. Rows without a number for x or y are skipped.
The file of each position is the first of file_id, file and filenumber that the row fills and the ROI manager has; a row that names a file the manager does not have is skipped, and the text says how many were. With replace, the ROIs this method made in the files it adds to go first.
Which table. The file the ROI manager shows, under its filter, as for the circle template; each example on its own file, under that file's filter. The examples may lie in any file, the search is in the one shown.
The examples are measured on ROIProject.indices: the rows of the table the ROI manager shows, under its filter, that the ROI holds – its polygon, or the manager's circle or square, narrowed by its frame and z ranges. An ROI of an id alone (a track) is not an example.
The values. n_locs counts the localizations inside; rmsd_nm is Picasso's: the root-mean-square distance of those localizations from their centre of mass, which for a candidate is its centre once it has stopped moving. It includes the localization precision. radius_nm is a disc's radius from the same spread with the precision taken out, , as for the circle template's discs;
roundness, psf_nm and touching as above. compare may name any of them but touching.
The candidates have the ROI manager's shape and size: a circle of diameter , or a square of side
(its localizations those within
in x and in y). A free shape among the examples is compared with them all the same, so for a structure that fills it the counts agree only if its area is about the manager's.
The mean shift moves every circle at once to the mean position of the localizations inside it until it moves less than 0.1 nm, or 100 times. Circles that stop within 0.1 nm of each other are one candidate.
The grid is triangular with a spacing of one radius , so no point of the field is farther than
from a circle's start and even a structure much smaller than the circle starts inside one.
The window is for each value, with
the spread and
the sample standard deviation of the examples (at least 2 are needed); for
n_locs, is at least
– a count cannot vary less than Poisson's – and the lower end at least 3.
Order. A candidate's distance from the examples is , with
the middle of the window and
its half-width; candidates are taken nearest first, and one whose circle overlaps one already taken, or an ROI already in the file, by more than half the radius is dropped (
too_close, the circle template's rule).
The examples stay. They are ROIs already, so no ROI is made on them. An ROI this method made is never an example, so a second run, with replace, learns from the same ones; with examples on a keyword, an ROI an earlier run made and that you then gave the keyword is an example and replace leaves it.
Picasso finds the same window from with the population standard deviation, lays its grid one diameter apart, and keeps the first candidate in grid order where two overlap. Each is changed here for a reason. Five examples underestimate the spread of the structures they stand for: on 150 simulated discs of 40 localizations their standard deviation of
n_locs was 3.6 against the true 9.6, and the window found 60 % of the discs; with the sample deviation and the Poisson floor, 80 %, and still none of the clutter beside them. A grid a diameter apart leaves points from the nearest start, outside every circle. And taking the best candidate first keeps one on junk from pushing out a good one beside it.
| setting | default | what it does |
|---|---|---|
presetpreset | - | A structure's values, which fill the settings; -: the settings as they stand. |
methodmethod | circle template | How the regions are found. Choices: circle template; beads; from an id attribute; positions from a file; like examples |
| circle template | ||
shapecircle.shape | disc | A ring of localizations, or a filled disc. ring for structures labelled on their rim (nuclear pores, rings of a protein); disc for filled ones (pits, clusters, blobs). A ring is also found by a disc of its size, as a disc with a low |
min radiuscircle.min_radius_nm | 30 nm | The smallest radius looked for; equal to the max for one radius. With max radius, the sizes looked for. Equal for one radius, which is fastest and most selective – NPC uses 55 nm for Nup96 at about 54 nm. A range costs a filter per radius (each about 15 % apart). The smallest also sets how close two maxima may be, so too small a value for the structures lets a large one break into several candidates, which the overlap rule mostly removes. at least 1 nm |
max radiuscircle.max_radius_nm | 150 nm | The largest radius looked for. Larger than the largest structure you want; a much larger value lets neighbouring structures merge into one large candidate where they are dense. at least 1 nm |
ring widthcircle.ring_width_nm | 15 nm | Half the width of the ring's band, and the width of the filter's ring. About the localization precision plus the label's size, 10 to 20 nm. Read only for a ring. at least 1 nm |
judge on precision (more)circle.precision_nm | 20 nm | The fits and the far test use only localizations more precise than this. The same as NPC Corners' corner precision, so that the pores are judged on the localizations they are counted with. Looser lets more imprecise ones into the fits and the far test; tighter leaves sparse structures too few to judge (3 are needed). at least 0.1 nm |
bin (more)circle.bin_nm | 10 nm | Pixel size of the density image that is filtered. Smaller than the ring width; 10 nm is right for most data, larger for a field too big for 16 million pixels. Only the speed and the memory depend on it much. at least 0.1 nm |
| beads | ||
min photonsbeads.min_photons | 5000 | Localizations dimmer than this are not beads. Between the brightest molecules and the beads: a bead gives several times the photons of a dye molecule. Look at the photons of a few beads. |
min lengthbeads.min_fraction | 0.25 | A bead is seen in at least this fraction of the frames. Most beads are seen in nearly every frame; 0.25 keeps one that came loose or bleached part of the way, which Fiducials can still use. keep with |
maximum jump (more)beads.max_jump_nm | 150 nm | The farthest a bead moves between the frames it is seen in. at least 1 nm |
memory (more)beads.memory | 50 frames | Frames a bead may be missing from its track. |
| from an id attribute | ||
attributeids.column | cluster_id | An id attribute of the table; -1 is in no region. Any attribute of whole numbers: |
at leastids.min_size | 10 locs | The localizations an id needs to become an ROI. Large clusters are usually the interesting ones and small ones are noise: a few times the localizations one fluorophore gives. The attribute keeps every cluster either way, and a filter on |
the cluster's own outlineids.outline | on | Each ROI the convex hull of its cluster; off: only the centre, with the ROI manager's circle or square. The hull follows each cluster but makes ROIs of different sizes; the circle or square makes them all alike, cutting off any cluster larger than it, and taking in the localizations around a smaller one. Read only when an ROI holds is what is in its shape. |
an ROI holdsids.membership | what is in its shape | Its shape: every localization inside, whatever its id; its id: that id's localizations only, as a track whose path others cross. Its id alone for tracks, and for clusters that overlap, where a shape would mix two of them; what is in its shape where the area is the point – the localizations of every kind near a cluster, measured in the same window round each. Choices: what is in its shape; its id alone |
draw it asids.draw | auto | In the ROI manager: a line through its localizations in frame order, or the hull round them; auto: a track for a track attribute. Read only for its id alone. A track's line shows its direction and its steps; an outline is the better picture of a cluster, whose localizations have no order. Choices: auto; a track; an outline |
keepids.keep | – | Which ids become ROIs, by their trace's values, e.g. eccentricity >= 3 and displacement_nm >= 300 for motors; empty: all. Separate from the other methods' keep, which names what they measure. For motors, start with |
only in both coloursids.both_colours | off | Only the ids seen in both colours of a two-colour table (MINFLUX dual colour's pair_id). |
angleids.angle | none | The ROI's angle from its trace: for directed tracks (motors); none for diffusion, where it means nothing. Only for directed tracks. long axis, forward in time is the robust choice for a straight run; first to last localization for a track that curves. Left at none, the ROIs get no angle and nothing is measured. Choices: none; long axis, forward in time; first to last localization |
| positions from a file | ||
filefile.path | – | A table with x_nm and y_nm, and optionally the file each position belongs to. A table written by Export table (with ROI position), or any csv with |
| like examples | ||
examplessimilar.examples | used ROIs | Which ROIs are the examples; never those this method made. used ROIs is the quick way: put ROIs on a few good structures and run; untick one to leave it out. a keyword is for a project that holds other ROIs too: make a keyword list under annotate in the ROI manager (for example kind, with the keyword example) and give the good structures the keyword with its number key. Choices: used ROIs; all ROIs; a keyword |
keyword listsimilar.keyword_list | - | The ROI keyword list that marks the examples. Read only for a keyword; the list may hold other keywords too. |
keywordsimilar.keyword | – | The keyword the examples have in that list. As written in the list; the examples need not be used ROIs. |
comparesimilar.compare | n_locs, rmsd_nm | The values a candidate must share with the examples, comma separated.
|
spreadsimilar.spread | 2 SD | A candidate's values lie within the examples' mean plus or minus this many standard deviations. 2 keeps about 95 % of structures like the examples if their values are normally distributed. Raise it when too few are found, lower it when clutter gets in; the keep figure shows where the window falls. at least 0.1 SD |
keepkeep | n_locs >= 10 | Which candidates become ROIs, e.g. n_ring >= 4 and 40 <= radius_nm <= 70; empty: all. A preset writes it; change it after looking at the keep figure of a Preview, where every value it reads is drawn for the kept and the rejected candidates. The form lists the values the method measures. |
keep rejectedkeep_rejected | off | Add the candidates keep rejects as ROIs that are not used, to look at them. Tick it while choosing keep: each rejected candidate becomes an ROI that is not used, its origin lists what it failed, and its values are in the results table to sort by. Preview shows them too, dotted, without making them ROIs. |
replace earlier ROIsreplace | on | Remove the ROIs this segmenter made on the file before finding them again. On, a second run gives a fresh answer: the ROIs the same method made on the file before go first (each ROI's origin says which) – for from an id attribute, those it made of the same attribute, in every file. ROIs drawn by hand or made by another method stay either way: beads found after the pores keep the pores. Off, a run adds to what is there; for the circle template and beads a candidate on an existing ROI is suppressed, so running again with the same settings finds nothing new, which is why it is on by default. The ROI manager's Undo brings replaced ROIs back. |
n_locs, radius_nm, roundness, psf_nm, touching, and the method's own: n_ring, n_inside, n_outside, far_p for a ring, centre_ratio for a disc, frames_fraction, photons, spread_nm for beads, rmsd_nm for like examples – are columns of the ROI manager's results table (segment.<name> where a measurement already has the name), so Filter ROIs, Sort ROIs and the summaries read them. They describe the candidate as it was found, and stay when the ROI is moved.data["window"]. Choose the ROI manager's ROI size to hold a whole structure and little around it, about its radius plus two precisions: smaller and an ROI settles on parts of one structure, larger and it takes in its neighbours.A good result has one ROI on each structure and none on the background. ROIs on the background: tighten keep (more localizations, a narrower radius). Faint structures missed: loosen it, after checking in the keep figure that they are among the candidates. None at all: the radii do not match the structures.
Run without the ROI manager, from a script (Context(locs=locs)), it returns every candidate with its values, use and what it failed in data["sites"], and the centres of those kept in data["centers"].
The ROIs in the ROI manager; the text says how many were made, the smallest cluster that became one, how many clusters had no outline, and how many ids keep left out, by the clause they failed. With keep or angle set, each ROI's trace values are columns of the results table, and with angle its roi_angle_deg is the direction its trace moved. It cannot run inside a block, which repeats over regions: make the ROIs after it.
The ROIs in the ROI manager; the text says how many were made, from which file, and how many rows named a file the manager does not have. It cannot run inside a block.
Ported from SMAP's ROIManager/Segment/segmentNPC and its clean-up evaluator (SMAP's word for a plugin run in every ROI) ROIManager/Evaluate/NPCsegmentCleanup, and replacing the script segmentCME (Ries 2020).
segmentCME blurs the rendered image with a Gaussian of 2 pixels and keeps the maxima above 80, inside a region drawn by hand. Here a zero-sum template does both jobs at once, a disc for pits, over a range of radii, and what decides is keep on numbers of localizations, which mean the same at any pixel size.psf_nm, for the user to add where the table has sigma_nm.fitposring is plain least squares on all of them.SMAP's ROIManager/Segment/segmentBeads merges the localizations within 150 nm into groups, allowing minimum frames (30) of gap, takes a group of more than that many localizations as a bead, and puts a site at its position in each cell of a grid it makes first; a Filter button then excludes the beads whose smallest PSF width, or the frame of it, is far from the others' – a check for a bead stack scanned in z. Here the beads are the bright, long tracks of Fiducials' linker, on the whole file without cells, with a threshold in photons and a length as a fraction of the frames, and the check is keep on the values measured; a bead stack is the PSF calibration's business, which finds its own beads.
SMAP's ROIManager/Analyze/ImportSitePositions copies the sites and cells of another SMAP file into the current one, the files matched by their order. Here the positions come from any table, a csv written by Export table among them, and each goes to the file it names.
New: SMAP has no segmenter that makes sites of clusters; its DBSCAN writes the cluster index and makes no ROIs.
New: SMAP has no segmentation by example. It is ported from Picasso's pick similar (Render's Tools, postprocess.pick_similar, MIT licence), with the changes in In detail.
SMAP has a segmenter per structure in ROIManager/Segment – segmentNPC, segmentCME, segmentBeads, ... – each with its own settings. Here one plugin has a method per model of a structure, and a structure is a preset of values, so a structure the methods already find needs a file, not a plugin.