Panel 1 holds the real-space image. The tools run vertically along the left edge of the panel, organised into groups. Each square is a group. Clicking a group that holds several tools opens a small pop-up column of sub-squares beside it; you then click a sub-square to activate that tool. A group with only one tool activates it directly. You do not have to click to find out what a group holds: resting the pointer on the square opens the icons of the tools inside in a column beside it, with the group's name written across the first of them. They can be clicked from there directly. Click an active tool again to deactivate it. While a tool is active a parameter window appears at the bottom of the panel; hover any parameter label for an inline tooltip. The sections below are arranged by group, in the same order as the squares in the panel.
If a group described below is missing from your panel, check the user-level button at the top right: while it reads Basic the Filter, Amyloid, Particles and Align groups are hidden. Click it to switch to Advanced — the default — and they come back.
Histogram-side toggles
Two toggle buttons sit to the left of the panel-1 histogram, stacked vertically with a small gap:
- mark image center — places a red plus sign at the geometric centre of the image, in the same style as the origin cross drawn on the Fourier-space display in panel 2. Click again to remove the marker.
- freeze display contrast — locks the current real-space display range across subsequent Compute operations. When off, contrast auto-scales to the full dynamic range after each operation.
Both buttons use a raised 3D look when off and a sunken look when on. The histogram hint above reads “Click to adjust display contrast” — click the histogram bar to drag the white triangles for manual range adjustment. When a parameter window opens at the bottom-left of the panel, the toggle buttons remain partly visible behind it; clicks on the visible portion still toggle them.
Edit
Eraser
Multiplies pixel values by (1 − Gaussian) under a soft
footprint, smoothly fading them toward zero. Useful for removing
unwanted features without a hard edge that would generate ringing in
Fourier space.
Use: click and drag in panel 1 to erase along a path.
Paint brush
Writes a chosen pixel value into the image, blended with the existing pixels through a Gaussian or solid-disk footprint. The image min/max scale at the bottom of the panel is a useful reference for picking a sensible value.
Solid diameter: width of the flat-top region of the brush.
Gaussian diameter: width of the Gaussian fall-off. Set to 0 for a sharp edge.
Have some fun: Create an empty image (value 0 everywhere) and use the paint brush to place one single pixel of value 1 into the image. The Fourier transform of that will be flat white (value 1 everywhere, but potentially with interesting phases), because the Fourier transform of a delta function is a constant. If you now place a second pixel into the real-space image, then the Fourier transform will show an interference pattern, so you can use it to test the Fourier-space tools and to get a visual intuition for how they work. Try combining this with the symmetry tool in real space, and with the filter tool in Fourier space, to see how the symmetry and periodicity of the real-space image affect the Fourier transform.
Taper edges (Hanning)
Apply a Hanning window of a chosen width around the image border. This suppresses the sharp edges that would otherwise leak into the FFT as a strong cross of high-frequency content.
Threshold histogram
Act on the grey-value range you have marked in the histogram below the image. Drag a range across that histogram — the same gesture you use to adjust the display contrast — and this tool turns that selection into a real change to the pixel values: pushing everything outside it out to black and white, clipping it away, or dropping it to black so that only the marked band of density is left.
The two fields open on whatever the histogram currently has selected, and follow it: drag a new range there and they update, so marking the range is normally all you need to do. They can also be typed in directly, and if you give them the wrong way round they are swapped. Pixels inside the range keep their own grey values in all three modes; the modes differ only in where the pixels outside it are sent.
Mode — Truncate histogram: a pixel below the minimum is set to that minimum, and one above the maximum to that maximum. The values are clipped, so nothing outside the range survives at all and the image's span shrinks to the range itself. Use it to cut off hot pixels or a runaway background before an FFT.
Mode — Select histogram: everything outside the range — on both sides — is set to the image's current minimum, while the pixels inside it keep their own grey values. Only the chosen band of density is left standing, against a flat background. This is the mode that differs from Threshold histogram only above the maximum: there, bright outliers are pushed up to full white; here they are dropped to black along with the dark ones. Use it to isolate one class of feature by its density — the protein but not the support film, say — and then measure, mask or transform what is left.
Keep grey values from / to: the range that survives untouched. Defaults to the histogram selection.
Cancel / Compute: Compute applies the change to the image in place, in the active history slot, and recomputes the Fourier transform if one was showing. Return in either field does the same. One undo step per application.
Measure
Measure
Click and drag in panel 1 to measure distances. The pixel count and the corresponding distance in Ångström (using the slot's pixel size) are shown next to the line.
Transform
Flip horizontally / Flip vertically
Mirror the image along its horizontal or vertical axis. Pure geometric operations, lossless. The Fourier transform updates accordingly.
Shift image
Translate the image by an integer number of pixels in x
and y. The shift is cyclic (wrap-around), so no pixel
values are lost.
Drag on the image to set the shift. While you drag, a yellow arrow runs from the point you grabbed to the current cursor position, with the displacement in image pixels shown beside it, so you can see how far the image will move before you release. The image is translated by that amount when you let go.
Rotate image
Rotate the image by a chosen angle. The corners are clipped if the rotation is non-trivial; consider padding the image first if this matters for downstream FFT analysis.
Shear image
Skew the image about its centre, turning a square into a slanted
parallelogram. A horizontal shear slides each row
sideways by tan(angle) × (its distance from the image centre),
so vertical lines lean over by the shear angle while horizontal lines
stay horizontal. A vertical shear does the same to the
columns: horizontal lines tilt, vertical lines are left alone. Positive
angles lean the image to the right (horizontal) or lift its right-hand
side (vertical).
The image keeps its dimensions and stays in the same buffer — the sheared result replaces the image it came from, in the active history slot. Pixels that slide out of the frame are lost and the wedges left empty behind them are filled with the mean pixel value, so pad the image first if a strong shear has to be reversible. Resampling is bilinear, and the Fourier transform is recomputed if one was showing.
Drag on the image to skew it: the point you grab follows the cursor, and a yellow outline shows the frame the image will take, with the angle and the axis reported beside the pointer. The direction you drag in picks the axis — mostly sideways shears horizontally, mostly up or down shears vertically. How far the grabbed point sits from the centre line sets how much leverage the drag has, so grabbing near an edge shears gently and grabbing closer in shears harder; inside the middle 30% of the image the leverage is held constant, since on the centre line itself any drag at all would ask for 90°. The shear is applied when you release, and the angle and axis it worked out are written back into the parameter window.
Shear axis: Horizontal slides the rows, Vertical slides the columns.
Apply shear: commits the typed angle, updates the Fourier transform, and stores the result in the active history slot. Repeated applications compound.
Invert contrast
Replaces each pixel value with max + min − value. Often
useful for cryo-EM data where particles are darker than background and
you want a positive-contrast view.
Symmetrize image
Enforce N-fold rotational symmetry on the real-space image
around its centre. The image is averaged with N copies of
itself, each rotated by k·360°/N (k = 0…N−1),
so the result is identical under a rotation of 360°/N.
Rotated samples are bilinearly interpolated; samples that fall outside
the image are filled with the mean pixel value. The rotation centre is
the integer pixel (w/2, h/2).
N
(default 4). Use 2 for two-fold, 3 for three-fold, and so on; values
are clamped to a maximum of 64, and N = 1 does nothing. Apply symmetry: commits the operation, updates the Fourier transform, and stores the result in the active history slot.
Redimension
Bin image
Reduce the image dimensions by averaging adjacent pixels in
N×N blocks. The pixel size in the slot metadata is updated
accordingly. Binning is the cleanest way to reduce resolution; it
acts as a low-pass filter followed by downsampling.
Keep original size: if checked, the image is re-expanded to its original dimensions after binning so that pixel counts stay comparable across slots.
Pad image
Change the size of the canvas without changing the image inside it. The image keeps its scale and its pixel size throughout — this resizes the frame, not the picture. Use it to bring images onto a common size, which is what Math calculation and Align to reference want, or to give a specimen more empty surround before a Fourier transform.
Cancel / Resize image: the line above the buttons says in advance whether the current choice will pad or crop, and by how much.
A target larger than the image pads it: the image is centred in the new frame and the surrounding border is filled with the average grey of the outer 5-pixel frame of the original, so the fill matches the picture's own edge rather than its interior mean. The outermost 20 pixels of the original are faded into that grey with a Hanning roll-off, so the join carries no brightness step — an abrupt edge there would transform into a cross of streaks straight through Fourier space, which is exactly what the taper exists to prevent.
A target smaller than the image crops it instead, again about the centre. A cropped edge is a plain cut and is not tapered, because there is no new grey beside it to blend into; use Taper edges afterwards if that edge needs softening.
Either way the operation is centred, so whatever sits in the middle of the image stays in the middle. That is the property that makes this the natural partner of Rotation align, which turns an image about its centre.
Crop image
Cut a square region out of the image and replace the slot with it. When the tool is activated no region is selected yet. Drag on the image to open a square selection: a 50 % transparent white box with a white border follows the cursor. The selection is always kept square (1:1 aspect ratio) and is clamped to the image bounds. To reposition an existing square, click inside it and drag — the box keeps its size and follows the cursor. Dragging outside the current square starts a new selection. Right-click clears the current selection.
Bottom right coordinate: X / Y of the lower-right corner.
Both corners can be typed for an exact selection; the field you edit sets the side length and the opposite corner follows so the box stays square. The fields update live while you drag or move the square.
Press Crop image to replace the current slot with the selected region (the original is kept on the undo stack), or Cancel to dismiss the tool. Cropping does not change the pixel size; only the image dimensions change.
Filter
Gabor filter
Apply a Gabor (oriented sinusoidal) filter to the image. The filter emphasises features that match the chosen wavelength and orientation, making it useful for finding striations, lattice rows, or oriented texture.
A Gabor filter is a cosine wave multiplied by a Gaussian envelope — a short piece of a stripe pattern. The image is convolved with that kernel, so the response is largest where the image locally looks like the kernel: stripes of the chosen period, running in the chosen direction. It is a band-pass filter that is also orientation-selective, which is what distinguishes it from the isotropic Bandpass filter in panel 2. Formally, with coordinates (x', y') rotated by θ:
g(x',y') = exp(−(x'² + γ²y'²) / 2σ²) · cos(2πx'/λ)
Wavelength lambda: the period of the cosine, in pixels. This is the feature spacing the filter is tuned to: stripes with this period give the strongest response. Keep λ ≥ 2·σ so the carrier completes at least one cycle inside the envelope.
Orientation (deg): direction of the intensity modulation. At 0° the filter is modulated along the horizontal axis and so responds to vertical stripes; at 90° it responds to horizontal stripes. The angle is measured from the +x axis towards the bottom of the image: because the image y axis points down, increasing θ turns the pattern clockwise as it appears on screen. Scan 0°, 45°, 90°, 135° to cover the major orientations.
Aspect ratio gamma: the ellipticity of the envelope. 1.0 is circular; values below 1 stretch the envelope along the stripes, making the filter longer and more directional. Typical: 0.3–0.7.
Cancel / Compute: Compute replaces the image in the active buffer with the filter response.
The kernel is built out to 3σ and then has its mean subtracted, so it is zero-mean: flat regions give no response and the overall brightness of the image is discarded. The output is therefore signed — a stripe pattern in phase with the cosine gives a positive response, one shifted by half a period gives an equally negative one, and a zero response lands between black and white once the display rescales to the new range. The carrier phase is fixed at 0, i.e. the kernel is symmetric (an even, cosine Gabor), so it responds to bar- and ridge-like features rather than to edges. Only this single response is computed — this is not the magnitude of a quadrature pair, so the result is phase-sensitive rather than a smooth oriented-energy map. Edges of the image are handled by mirroring.
Choosing parameters. Set λ to the spacing of the features you are after — for a striated or layered structure, the centre-to-centre repeat in pixels; then set σ to about λ/2 so the kernel spans roughly two cycles, and lower γ to about 0.5 to make the filter more selective in direction. If you do not know the repeat, read it off the Fourier transform in panel 2: a layer line or spot lying q pixels from the centre of an N×N transform corresponds to a real-space repeat of λ = N/q pixels, and the direction from the centre of panel 2 to that spot is the direction to enter as θ — measured on screen the same way, from +x towards the bottom. Such spots always come in pairs on opposite sides of the centre, and either one gives the same answer: θ and θ+180° describe the same stripes. Because the tool overwrites the buffer, copy the image to a second buffer first if you want to compare responses at several orientations side by side.
See also the Hessian filter (below), which enhances ridges of a given width at any orientation, and so answers a different question: Gabor asks “where does the image look like stripes in this direction?”, Hessian asks “where does the image look like a ridge, whichever way it runs?”
Hessian filter
Compute a Hessian-based ridge / blob enhancement. Good for highlighting filaments and elongated features whose width matches the chosen scale. The Hessian filter is a second-derivative operator that responds strongly to curvilinear structures, making it useful for tracing filaments or enhancing tubular features in the image. It is most powerful when the scale parameter is tuned to match the width of the features of interest, as it suppresses structures that are either much thinner or much thicker than the specified scale.
How it works. The image is first smoothed with a Gaussian of width σ, which is what selects the size of the structures the filter sees. The tool then measures, at every pixel, how the brightness curves: the three second derivatives Ixx, Iyy and Ixy, arranged in the 2×2 Hessian matrix. The two eigenvalues of that matrix are the curvatures along the two principal directions, and their eigenvectors say which way those directions point. On a ridge the picture is characteristic: strong curvature across the ridge, almost none along it. The filter keeps the eigenvalue of largest magnitude — the strongest curvature at that pixel — and the response is that value multiplied by −polarity, with anything still negative clipped to zero. The derivatives are multiplied by σ² (γ-normalisation), which makes responses at different σ comparable rather than shrinking as σ grows.
Polarity (+1/−1): which sign of ridge to keep. +1 enhances bright ridges on a dark background; −1 enhances dark ridges on a bright background (dark fibres, carbon edges). Any positive number counts as +1 and any negative as −1.
Cancel / Compute: Compute replaces the image in the active buffer with the filter response.
Because the opposite polarity is clipped away, the output is non-negative: bright means “ridge of the requested sign here”, and zero means both “flat” and “ridge of the wrong sign”. If a filtered image comes out nearly blank, the polarity is the first thing to check. Note also that the filter keeps the largest curvature whatever its shape, so it is a ridge and blob detector: compact dots respond as strongly as filaments, and it does not separate the two the way a dedicated vesselness measure would.
Amyloid fibrils in cryo-EM. Fibrils are dark, but with the default polarity the filter responds to bright structures. On such images, first invert the contrast with Invert contrast (or set the polarity to −1), then apply heavy downscaling with the Bin image tool — this both reduces the noise that second derivatives amplify and brings the fibril width down to a few pixels, so a small σ matches it. The Hessian filter then responds to the enhanced structures, providing a fast and effective way to enhance filaments of a certain width.
Second derivatives amplify noise, so on any noisy image increase σ, bin the image first, or low-pass filter it before applying the filter. You can also combine it with the Gabor filter for orientation-specific enhancement: the Gabor filter selects a single direction, whereas the Hessian filter responds to ridges running any which way.
Hough transform
Find straight lines or circles by voting. The Hough transform turns a shape-detection problem into a peak-finding problem: every edge pixel votes for all the shapes of the chosen kind that could pass through it, and wherever many edge pixels agree, the votes pile up into a bright spot. The result is the accumulator — a map of how much evidence there is for each possible shape — and it is written to the chosen output buffer at the input's dimensions, so it can be contrast-adjusted, Fourier transformed, peak-searched or undone like any other image. Both buffer pulldowns open on the buffer you are looking at, so the transform replaces its own input unless you send it somewhere else.
How it works. The input image is first run through a Sobel operator, and only the strongest gradients are kept as edge pixels — the top tenth of the magnitudes, so the cut adapts to the image's own contrast rather than to a fixed number (the list is capped at 250 000 points, which only a very large image reaches). Each surviving pixel then casts its votes, spread over the neighbouring accumulator bins so a peak grows smoothly instead of splitting across a bin boundary. Nothing beyond the three pulldowns needs setting; if the transform comes out empty, the image had no edges to vote from, and a Hessian or Gabor filter beforehand will usually give it some.
Reading the result. For the circle options the parameter space is image space — the coordinates of the centre — so the accumulator stays in register with the input: a bright spot sits exactly where a circle of that radius is centred. Send the result to a different output buffer and you can click between the two in the buffer strip to see which feature produced which peak; leave both pulldowns on the same buffer and undo/redo does the same job. That holds for the two multi-radius options as well — their result is still a map of where the circles are. For Lines the axes change meaning: the horizontal axis is the line's angle θ, running 0° at the left edge to 180° at the right, and the vertical axis is its signed perpendicular distance ρ from the image centre, running from −½√(w²+h²) at the top to +½√(w²+h²) at the bottom. One bright spot there means one straight edge in the image; two spots at the same θ but different ρ mean two parallel edges. Note that the pixel size no longer applies to a line accumulator, since neither axis is a distance in the image.
Output buffer: where the accumulator is written. It is overwritten and becomes the displayed buffer. It also opens on the buffer you are looking at, so by default the transform replaces its own input; point it at a free buffer to keep the original alongside the result.
Geometric element: what the accumulator votes for. Lines gives the classic (θ, ρ) transform, voted at half-degree steps. Circles, one radius votes for circle centres at the single radius set by the slider below — pick the one closest to the features you are after, since a circle of the wrong size gives a much weaker, ring-shaped response. Circles, radii 5,10,20,30,40,50,60 sums the accumulators for those seven sizes, so anything circular appears whatever its size and a centre that works at several sizes is reinforced; it costs seven single radii. Circles, find radius automatically is described below.
Circle radius: the radius voted for, 5 to 60 pixels, with the value shown beside the slider. The row appears for Circles, one radius, in either direction. Letting go of the handle runs the transform, so you can find the right size by dragging: each such run replaces the one before it rather than stacking, so a whole exploration costs one undo step and always transforms the original rather than the accumulator it just produced.
Inverse Hough transformation: run the transform backwards instead — see below. The element pulldown and the radius still apply, since they say which shape each accumulator cell is turned back into.
Cancel: closes the tool without touching the image.
Compute: runs the transform and writes the accumulator to the output buffer, which then becomes the displayed one. One undo step per run.
Finding the radius automatically. If you do not know how big your features are, choose Circles, find radius automatically. The tool then runs the circle transform at every radius from 5 to 60 pixels, one pixel at a time, scores each result, keeps the radius that scored best, and finally applies the transform at that radius alone — so what lands in the output buffer is an ordinary single-radius accumulator, not a blend. The radius it settled on is reported in the parameter window, which is usually the more valuable half of the answer: it is a measurement of how big your particles are.
The score is not the height of the peak. A larger circle has more rim pixels voting on it, so the raw maximum drifts upwards with the radius whatever the image actually contains, and picking the largest would pick 60 px every time. What is scored instead is how far the peak stands above the accumulator's own background, measured in units of that background's own spread — a quantity that does not care how many votes were cast in total. On a test image of discs of a known size it returns that size exactly, and on a real micrograph it agrees with the radius you get by measuring the particle rim by hand.
It is the slowest option in the tool, being fifty-six single-radius transforms plus the one it finally applies, so expect it to take a few seconds on a large image; the progress bar fills across the parameter window as the sweep runs. Two cautions. The radius is only meaningful if there are circles to find — asked of an image without any, it will still report whichever radius scored best. And the search is bounded at 5 and 60 pixels, so features outside that range are simply not among the candidates; bin the image first if your particles are larger.
The inverse transform. Tick Inverse Hough transformation and the tool runs the other way: the input buffer is read as an accumulator, and every cell in it draws the shape it stands for back into the output image. The element pulldown says which shape, so it still applies — and so does the radius, which keeps whatever value it was last used with.
With Lines, a cell at column x, row y means the line at angle θ = 180°·x/(w−1) whose perpendicular distance from the image centre is ρ, read off the vertical axis the same way the forward transform wrote it — so a forward pass followed by an inverse pass puts the lines back where they came from.
With any of the circle elements it is simpler still, because a circle accumulator is already in image coordinates: a cell is a centre, and what gets drawn is a circle of the chosen radius around it. So running the circle transform forwards and then backwards recreates the discs it found — outlined rather than filled, since it is the rims the transform knows about. The fixed ladder draws all seven of its radii, and the automatic element draws the radius it last found.
That is what makes the pair useful. Run Lines on an image, then use Threshold histogram on the accumulator — Select histogram is the natural mode — to mark the range that holds the peaks and drop everything else to the background. Feed that filtered accumulator back in with Inverse Hough transformation ticked, and what comes out is a clean picture of only the straight lines that survived the filtering, in the original image's coordinates: the lines found, with the noise, the texture and the curved edges left behind. Vary how much of the histogram you keep and you vary how many lines are returned.
The same three steps work for circles, and give you the particles you found drawn as rings on an empty field: run one of the circle elements, select the peaks in the histogram, then transform back with the radius left where it was. It is a quick way to check a pick — anything that comes back in the wrong place, or does not come back at all, tells you the radius or the threshold needs another look.
Cells sitting at the accumulator's minimum count as background and draw nothing, which is exactly what a filtered accumulator is mostly made of. An unfiltered one works too, but every cell then contributes and the result is the familiar smeared back-projection rather than a set of distinct shapes; to keep that case from taking minutes, at most the 20 000 strongest cells are drawn. Each shape is deposited with the weight its cell carried, so a strong peak comes back bright and a marginal one faint.
Amyloid
Amyloid filament
Simulates cryo-EM images of helical amyloid filaments. This is a
generator, not an analysis tool: you give it a 2D
cross-section and a trajectory, and it builds the image a microscope
would have recorded from that filament. Use it to make test data whose
true helical parameters you already know, and then study what those
parameters do to the Fourier transform in panel 2.
This tool takes an existing image of a filament cross-section and produces a helical
filament image from it, replacing whatever is in the currently active slot — there is
no separate target selector, so switch to a scratch slot first if you want to keep
what is on display.
As source you can create an empty (black) image and draw a small snake trace into it.
Then use this tool to generate a long filament image from the trace, which can be used
for Fourier analysis of the filament's helical parameters.
You can also use the mouse to draw a long filament directly into the source slot,
and then use the mouse to add curvature to the filament trajectory. Use this to study,
how a bent filament's Fourier spectrum differs from that of a straight filament,
and to get a visual intuition for the effects of curvature on the Fourier transform.
How it works. The chosen cross-section map is first flattened against its background: the mean of its border pixels is subtracted, so the surroundings fall to about zero and only the central structure contributes. That cross-section is then treated as a thin 3D slab (a couple of pixels thick) and stamped repeatedly along each filament trajectory — one copy every helical rise, each successive copy rotated about the filament axis by the helical twist. The resulting 3D density is projected along the viewing axis to make the image. It is a genuine helical construction rather than a painted-on pattern, which is why the crossovers and layer lines in its Fourier transform behave the way real ones do.
Source map: the buffer (a…p) holding the 2D cross-section that is extruded along the filament.
Helical rise (Å): axial translation between successive subunits. The cross-β structure of amyloid gives 4.75 Å, the inter-strand spacing — the default.
Helical twist (°): rotation between successive subunits; negative is left-handed. Amyloid filaments are typically −1° to −2°.
Waviness wavelength (px) and Waviness amplitude (px): a gentle sinusoidal lateral bending of the filament, of this period and peak displacement. Set the amplitude to 0 to switch waviness off. Typical wavelengths are 30–100 px.
Persistence length (µm): filament stiffness — the length over which it keeps its direction. The trajectory you draw is relaxed until its radius of curvature is everywhere at least this large, so a big value straightens a hand-drawn trace and a small one lets it bend. Amyloid fibrils are typically 1–20 µm. Set to 0 to leave your trace untouched.
Add gray noise / Sigma: additive zero-mean Gaussian noise over the whole image, as a fraction of the peak filament signal: 0.1 is clean, 0.3 is moderate (SNR ≈ 3), 1.0 is very noisy (SNR ≈ 1).
White / Black signal: filament bright on a dark background, or dark on bright as in a real cryo-EM micrograph.
Filaments: click twice in panel 1 to place a filament's start and end; the count is shown live. Drag the control points to bend the trajectory. If you compute without drawing anything, one straight horizontal filament is generated across the middle of the image.
Cancel / Compute: Compute builds the image.
The crossover. Rise and twist together set the length of one full turn of the helix, which is the repeat of the projected image — the distance the tool's tooltips call the crossover distance:
crossover = (360 / |twist|) × rise
With the defaults (4.75 Å rise, −1° twist) that is 360 × 4.75 = 1710 Å, so a 1024-pixel image holds a little over half a turn. Note that if your cross-section looks much the same after half a turn — a flat, ribbon-like density, as amyloid cross-sections often are — then the visible pinch points where the filament looks narrowest recur at half that spacing, twice per turn. The generated image is fixed at 1 Å per pixel, which makes this easy to read: a distance in pixels is a distance in Ångström. Halve the twist to −0.5° and the crossover doubles; that is the quickest way to see how the twist controls the spacing of the layer lines in panel 2.
Suggested experiment. Generate a straight filament with noise off, compute the Fourier transform, and find the layer line at 1/4.75 Å⁻¹ produced by the rise. Then bend the trajectory, or lower the persistence length and let the relaxation curve it, and watch that sharp layer line smear out into an arc: curvature blurs the helical signal, which is exactly why real helical reconstruction cuts filaments into short, nearly straight segments. Turning the noise up then shows how quickly those layer lines disappear into the background — while remaining perfectly recoverable by averaging, since you know they are there.
Math
Math calculations
Combine images from two history slots with a chosen arithmetic operation. The result is written to a third slot.
Operation: add, subtract, multiply, divide, convolve, correlate, etc.
Inputs: two source slots from the history bar.
Use this tool to study the convolution and correlation theorems. These state that
the convolution of an image with another image is the same as the multiplication of their Fourier transforms.
And the correlation of an image with another image is the same as the multiplication
of one Fourier transform with the complex conjugate of the other. You can directly
try these out, by creating two simple images (e.g. a dot and a line), convolving or correlating them,
and comparing the result to the Fourier-space multiplication of their transforms.
Alternatively, multiply their Fourier transforms with the Math tool in Fourier space, and compare the
result to the convolution or correlation in real space.
Explicit convolution and correlation in real space are computationally very expensive. The Fourier-space multiplication is much faster. So this is a good way to get a visual intuition for why the convolution and correlation theorems are so useful in practice.
Average images
Average several image buffers into one, by summing them up. Useful for raising the signal-to-noise ratio of repeated exposures of the same specimen, or for combining aligned particles.
a…p tiles, one per buffer. Click a tile to include or
exclude that buffer; buffers that hold no image are dimmed and inert.
On opening, every occupied buffer starts selected. Target buffer: the buffer (a…p) the average is written to; any content it held is overwritten. Defaults to the buffer on display.
Cancel / Compute average: Compute builds the average and shows it in the target buffer.
How the average is formed. Each selected image is first brought onto a common intensity scale so that no single exposure dominates: working in floating point, its median is subtracted (so the background sits at zero) and it is divided by its standard deviation (so the contrast has unit spread). The normalised images are then summed and divided by their count. Finally the resulting mean image is scaled from its own minimum…maximum onto the 0…255 grey range for display.
Images of different size are handled the same way as Pad image: the output takes the largest input size, and each smaller image is centred and padded out to it, its new border filled with the average grey of the image's own rim and blended in over a 20-pixel Hanning taper so the join carries no brightness step.
Particles
Peak search
Locate local maxima in the image. The detected peaks can be displayed as green plus signs and exported. Useful for picking particles, dots, or crystalline reflections in a real-space image.
A typical workflow is to cross-correlate the image of a protein particle with a raw cryo-EM image, then high-pass filter that cross-correlation map so that peaks stand out more clearly, and then use the Peak search tool to pick the particles on the high-pass filtered cross-correlation map. While doing so, you can display the raw cryo-EM image in panel 1, while picking particles on the cross-correlation map that is stored in another buffer, so that you can visually verify that the detected peaks correspond to actual particles in the raw image.
The coordinates of the detected peaks can then be exported and used for particle extraction with the Extract particles tool.
How the picking works. Every pixel above the threshold is a candidate. The tool sorts them from brightest to faintest, takes the brightest, records it as a peak, and then blanks out every candidate within the exclusion radius of it — then repeats with the brightest of whatever survives, until none are left. So the exclusion radius sets a guaranteed minimum separation between picks, and each pick is the brightest pixel in its own neighbourhood. Note that this is not a local-maximum test: a broad bright plateau yields one pick, not none, and the result depends only on brightness order and spacing. Positions are whole pixels; there is no sub-pixel refinement.
Show / Hide positions: toggles the green plus signs.
Threshold: the cut-off, dragged as a fraction of the source buffer's own min–max range; the resulting value is shown next to the slider. Because it is relative to that buffer's range, the same slider position means different things on different maps. Both sliders re-run the search by themselves the moment you let go of the handle, so you can drag, release, look at the count and the crosses, and drag again without touching Compute. The search waits for the release rather than following the handle, so a drag costs one pass over the image and not one per pixel of travel.
Exclusion radius: minimum separation between picks, in pixels, from 5 to 200. Set it to roughly the particle diameter so that one particle cannot be picked twice. The floor of 5 is deliberate: an exclusion zone smaller than a few pixels no longer separates neighbouring particles but merely trims the shoulder of a single peak, so one object comes back picked several times over.
Peaks found: the live count, which updates on every search — the number to watch while tuning the two sliders.
Cancel / Compute: Compute runs the search; the window stays open so you can iterate. Since the sliders now run it themselves, Compute is mainly for re-picking after changing the source buffer or editing the map it points at.
Tune the two sliders against the Peaks found count and the green markers: lower the threshold until you start picking noise, then back off. One detail matters if you go on to Extract particles: the peak list stays in brightest-first order, which decides which particles survive if there are more of them than the montage can hold.
Extract particles
Cut sub-images of a chosen size around each picked peak and write them into a target slot as a montage. Combine with Peak search for a complete pick-and-extract pipeline.
The extracted particles are arranged in a montage in the target slot,
which has 1024x1024 pixels and either 64px or 128px wide particle images. That means, there will be
either 16 or 8 particles per row, depending on the chosen particle size. The particles will not be
rotationally aligned, so the montage will show the raw particle images as they appear in the original micrograph.
You can then use the Fourier space lattice filter with filter vectors of either <16,0> and <0,16>, or <8,0> and <0,8>
to pick out the lattice of particle images in the montage, and to suppress noise between the particles.
When using the Fourier lattice filter, do not smooth the edges use a diameter of 1,
so that you get a clean reconstruction of the average particle image without any blurring.
This works ok-ish for round particles, such as Apoferritin, but for elongated particles, such as ribosomes,
you would need to first rotationally align the particles, which is not implemented here.
Target image: the buffer the montage is written to. It is overwritten, becomes the displayed slot, and inherits the source's pixel size.
Particle size: box side length, 64 or 128 pixels, centred on each picked position.
Cancel / Compute: Compute builds the montage. The tool needs a peak list: without one it just says “First prepare a particle position list”, so run Peak search first.
The montage has a fixed capacity. The output is always 1024×1024, so the box size decides how many particles fit: 64 px gives a 16×16 grid = 256 particles, and 128 px gives an 8×8 grid = 64. If you picked more peaks than that, the extras are silently dropped — no warning. Because the peak list is ordered brightest-first, what you keep are the strongest picks, which is usually the sensible choice; but if you expected 400 particles and got 256, this is why. To keep more of them, raise the threshold in Peak search until the count fits, or extract in batches.
Boxes at the very edge of the micrograph are handled gracefully: any part of a box falling outside the image is filled with the average of that box's own in-bounds pixels, so an edge particle gets a flat, neutral surround rather than a black step that would streak across its Fourier transform. The particles are cut out but not otherwise processed — not recentred, not normalised, not rotated — and the display contrast is rescaled across the montage as a whole.
Average image tiles
Cut the source image into a grid of square tiles and average them all into one tile-sized image. Unlike Extract particles, which needs a peak list and lays the boxes out as a montage, this needs nothing but the image itself: the grid is fixed, so it is the quick way to see what a periodic image has in common from tile to tile, or to beat down noise by √N when the features already sit on a regular pitch.
The tiles are taken from a grid anchored at the top-left
corner and stepped by the tile size, so a
1024×1024 image gives 16×16 = 256 tiles at 64 px
or 8×8 = 64 tiles at 128 px. Only whole tiles count: if the
image dimensions are not multiples of the tile size, the leftover strip
along the right and bottom edges is left out rather than padded,
so no tile contributes invented pixels to the mean. An image smaller than
one tile in either direction produces nothing.
The result is a single tile × tile image — not a stack —
written to the target buffer, which then becomes the displayed slot. The
tiles are cut at full resolution, so the pixel size carries over
unchanged from the source.
Target image: the buffer the averaged tile is written to. It is overwritten and becomes the displayed slot.
Tile size: 64 or 128 pixels. It opens on whichever size Extract particles last used, since the two functions are normally run at the same box size; changing it here does not change the extract setting.
Cancel / Compute: Compute performs the averaging.
Align
Align to reference
Move one image onto another so that the two line up. The image to be moved, the reference it is aligned onto, and the buffer that receives the result are chosen independently, so you can align a onto b and drop the answer into c without disturbing either input. The reference itself is never modified.
The three buffer selectors sit side by side, each under its own heading — Alignment reference, Image source and Output buffer — with the pulldown directly beneath the heading. They are in that order because that is the order in which they settle: the reference is the one you choose once and keep, while the other two follow the buffer you happen to be looking at.
Image source: the buffer (a…p) holding the image that moves. Follows the buffer on display: it starts on whichever buffer was shown when the tool opened, and clicking another buffer in panel 3 or panel 4 while the tool is open moves it — and the output buffer with it — onto that buffer. So the way to align several images onto one reference is simply to click each of them in turn.
Output buffer: where the aligned image is written. It follows the source, so by default the image is replaced in place, and it has no exclusions: writing over the reference is allowed if you want it. Choosing a different one from the pulldown keeps it there until you click another buffer. The output buffer becomes the displayed one when the alignment finishes.
Image has tiles / Tile size: treat the source as a grid of square tiles rather than as one picture — see Tiled alignment below. The size pulldown is dead until the box is ticked, and offers 64 or 128 pixels, opening on whichever size Extract particles last used.
Cancel / Shift align / Rotation align / Full align: Cancel closes the window; the other three run the kinds of alignment described below, in increasing thoroughness. The window stays open afterwards, and the shift or angle that was found is reported on the line underneath.
Images of different size are matched up before any alignment runs. The smaller one is centred in a frame the size of the larger and the surrounding border is filled with that image's own average grey, with its outermost 10 pixels faded into that grey by a Hanning roll-off so the join carries no sharp step — a brightness step there would transform into a cross of streaks and swamp the correlation. Note that the image is padded, never scaled: enlarging it would magnify its content relative to the reference, and the two would then match at no shift and no angle. The result is written out at the larger of the two sizes. Images that already share a size are passed through untouched.
Whichever button is used, the aligned result becomes the displayed buffer and its Fourier transform is computed straight away, so panel 2 is never left blank waiting for you to press FT.
The diagnostics panel. Running any of the alignments opens a white overlay across panel 4 that stays until the tool is closed. It shows why a particular answer was chosen, which the number alone cannot: on the left, the cross-correlation map with zero shift at its centre and a yellow cross on the peak that was taken; on the right, the correlation of every trial orientation from −180° to +180°, with a red arrow on the angle that won. A shift alignment fills the left half, a rotation alignment the right half, and Full align both at once. Read them for confidence, not just for the answer. A peak that stands clear of its surroundings, or a single sharp maximum in the angle curve, means an unambiguous match; a peak lost among others of similar height, or a curve with several rival humps, means the alignment is a guess between near-equal options and deserves a second look. The map is reduced to at most 256 pixels across for display, taking each block's maximum so the peak is never averaged away.
Shift align cross-correlates the image with the reference through Fourier space — both are mean-subtracted first, so a bright background cannot swamp the result — and takes the position of the correlation maximum as the displacement between them. The image is then shifted by that amount cyclically: pixels pushed off one edge reappear at the opposite edge, so nothing is lost and no blank border appears. This is the same wrap-around behaviour as the interactive Shift image tool, only with the amount computed instead of dragged. The displacement is found to the nearest whole pixel; there is no sub-pixel refinement.
Rotation align turns the image through a full circle in 0.5° steps and scores every one of the 720 orientations against the reference, keeping the one that correlates best. The scoring is done over the largest circle that fits inside the image — the only region that stays inside the frame at every angle — and is normalised, so the number reported alongside the angle is a correlation coefficient between −1 and +1. Corners left empty by the final rotation are filled with the image mean.
Two things are worth knowing about the rotation search. It compares the two images as they lie, without trying any shifts, so if the object is also displaced, run Shift align first and then rotate — or reach for Full align, which does not need the two to be separated at all. And the 720 trial orientations are scored on a working grid capped at 512 pixels rather than at full resolution: half a degree still moves the outermost pixels of such a grid by more than two pixels, so the angle found is the same one, and only that winning angle is then applied to the full-resolution image.
Full align searches for the rotation and the shift together instead of one after the other. It walks the same 720 orientations in 0.5° steps, but scores each one not as it lands: at every angle the rotated image is cross-correlated with the reference and the height of the correlation peak — that angle's score at its own best shift — is what is recorded. The angle with the highest score wins, its shift is then measured again on the full-resolution image, and the rotation and the shift are applied together in one operation. The reported correlation belongs to that final result, and the angle curve in the diagnostics panel is labelled best shift to mark that every point on it was scored at its own displacement.
That joint search is what the other two buttons cannot do between them. A rotation turns the image about the frame centre, so it moves an off-centre object as well as turning it, and it therefore spoils the shift that Shift align had just found; alternating the two converges only when it converges at all. Because a rotation about the centre followed by a translation can express any rigid movement of the image, one pass of Full align covers every position and orientation at once, and there is nothing left for a second pass to find. It is the button to use when an object is both displaced and turned, which is the ordinary case.
The price is time. Asking for the best shift at an angle instead of the score as it lies costs a forward and an inverse Fourier transform per angle, so the sweep is scored on a grid of at most 256 pixels — half a degree still moves the rim of such a grid by more than one pixel, and only the winner is treated at full resolution. That keeps the whole thing to roughly twice what Rotation align costs: about a second for a 1024-pixel image in the desktop build, several times that in the browser, with the progress bar filling across the parameter window as the sweep runs. The scoring is normalised over the largest circle that fits inside the frame, exactly as in the rotation-only search, so the number it reports is comparable with the one Rotation align gives; the reference is masked to that circle, since it is the only region the image can still fill at every angle.
Tiled alignment. Tick Image has tiles when the source is not one picture but a grid of them — the montage Extract particles produces, say, or a crystal cut on its own repeat. The source is then divided into square tiles of the chosen size, anchored at the top-left corner, giving 256 small images at 64 px or 64 at 128 px for a 1024-pixel montage. Every tile is aligned onto the reference separately, and each aligned tile is written back at the position it was taken from. The output buffer therefore has the same dimensions and the same number of tiles as the input, and every tile in it holds its own aligned content — a montage of particles comes back as the same montage with each particle brought onto the reference, ready to be averaged (with Average image tiles) or filtered further.
Only the centre of the reference is used, cut to the tile size: a tile can only ever match something of its own size, so anything beyond that would score against nothing. A reference smaller than a tile is padded out with its own mean. This means you can align a montage of 64-pixel particle boxes against a full micrograph and still get a sensible answer — what is compared is the middle 64×64 of that micrograph.
All three action buttons work this way while the box is ticked, and mean the same thing they do for a whole image: Shift align lets each tile slide, Rotation align lets it turn, Full align searches both together. Everything — the search and the resampling that applies its answer — happens on the small cut-out tile alone, never on the surrounding image: a movement that would reach past a tile's edge takes that tile's own mean rather than borrowing from its neighbour, which belongs to a different particle. A strip along the right or bottom edge too narrow to hold a whole tile has no tile to align and keeps the source's own pixels unchanged.
Two practical notes. The angle steps are coarser than for a whole image — half a degree moves the rim of a 64-pixel tile by only a quarter of a pixel, so the sweep steps by about a pixel's worth instead — and Full align runs its sweep coarsely first and then refines it around the winner, because a joint search per tile is far dearer than one search for a picture. Even so it is the slow button here: expect a few seconds for a 1024-pixel montage in the desktop build and longer in the browser, with the progress bar filling as it goes. And because a tiled run performs hundreds of alignments rather than one, the diagnostics overlay in panel 4 stays blank; the line under the buttons reports the tile count and the mean shift, angle and correlation across all of them instead.
The natural next step is Average image tiles in the Particles group: run it on the aligned montage, at the same tile size, and the tiles that were just brought into register are averaged into one — which is the classic pick, box, align, average sequence.