Panel 1 — real-space tools

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. 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.

Histogram-side toggles

Two toggle buttons sit to the left of the panel-1 histogram, stacked vertically with a small gap:

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.

Diameter: width of the Gaussian footprint, in image pixels.
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.

Pixel value: the value to paint.
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.

Hanning width: width of the cosine-taper band, in image pixels.

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.

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.

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

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).

Symmetry to apply: rotational order 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.

Bin factor N: integer divisor (2, 3, 4, …).
Keep original size: if checked, the image is re-expanded to its original dimensions after binning so that pixel counts stay comparable across slots.

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.

Top left coordinate: X / Y of the upper-left corner, in image pixels (origin at the top-left).
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 filterG

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'/λ)

Sigma (envelope): width of the Gaussian envelope, in pixels — how much of the image the filter looks at. Small σ is sharply localised but noisy; large σ is smoother and more global. Typical: 2–8.
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 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 filterH

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.

Sigma (smoothing): the scale, in pixels, and the parameter that matters. It sets the width of the structures that respond: small σ picks out thin features, large σ broad ones. Start near half the expected feature width. Typical: 1–6.
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.

Amyloid

Amyloid filamentA

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.

Image size (px): side length of the generated image. The output is always square and replaces the image in the active slot. Filament traces you have already drawn are rescaled to the new size.
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.

Output slot: destination (a–p).
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.

Particles

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.

Source image: the buffer (a…p) the boxes are cut from — normally the raw micrograph, even when the peaks were picked on a correlation map.
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.