4d — File Preview

Images, animations and 3D volumes in Manual Processing · 4d User Manual

← Back to Manual Processing

File Preview — images, animations and 3D volumes

The File Preview panel sits at the lower right of the Manual Processing tab, below the Results and Images panels, and shows the file selected in either of them: the pictures, animations and text files a script produced, and its 3D maps and stacks in an interactive volume viewer. Two lines summarise the file above the preview. The panel title names the file and holds two buttons at its right: File Information (page-and-eye icon), which replaces the preview with the file's full information sheet, and the small square ? button, which opens this page.

In the Modern interface style there is no File Preview panel: the same viewer opens in Quick Look, over the window, when a thumbnail in Results is double-clicked or selected and Space is pressed. Everything on this page works there: MRC images with Color, Background, Bar, contrast and brightness and their Reset buttons, 3D maps, animations, text and HDF5 files, a double-click into full screen or the MRC browser. Info on the Quick Look title line shows the two summary lines and the information sheet. ← → step to the file before or after, Space, Esc, the ✕ button or a click beside the card close it.

The File Preview panel showing a 3D map as an iso-surface

The File Preview with a 3D map (emd_19425.map, 154 × 154 × 154 voxels) in the volume viewer: the two header lines above the image, the file name with the File Information and ? buttons in the panel title, and below the image the mode buttons, Animate, Color with the scheme in brackets, Background, View, Bar and Reset, and the Threshold, Denoise and Rotation axis sliders. The map is shown as a surface in the Rainbow scheme on a black canvas without the box outline; the histogram in the top-right corner is drawn while the Threshold slider is in use, its orange bar at the current level. The axis triad sits in the lower left, the scale bar in the lower right.

How a file is shown depends on its kind:

FileShown as
PNG, JPEG, TIFF, single-frame GIF, …A picture, scaled to the panel. Double-click opens the file in its external viewer (set in Preferences ▸ General ▸ Viewers).
Animated GIFPlays in place, with a bar of controls underneath: rewind to the first frame, step back, play, pause, step forward, and slower / faster playback (10 % to 800 %, the current speed shown between the two buttons).
MRC map or stack with more than one section (.mrc, .map, .mrcs)A rotatable 3D rendering in the volume viewer, described below.
2D MRC imageThe same viewer, shown flat: drag to pan, scroll to zoom, with the colour schemes, contrast, brightness and scale bar of the volume viewer. While Contrast or Brightness is moved, the histogram of the pixel values is drawn over the image (see below). Double-click opens the image in the MRC browser, full screen, with its Fourier tools.
HDF5 (.h5)The file's information sheet — its datasets, their shapes and compression — instead of a thumbnail.
Text (.txt, .log, .results, .star, scripts, …)The contents, with syntax colouring for scripts. A file with another extension is shown as text when its contents look like text.
The File Preview panel showing a 2D MRC image flat

A 2D MRC image (merge-p4.mrc, 400 × 400 pixels) shown flat in the same viewer, in the Viridis colour scheme on a white canvas, with the x and y axes of the triad and the scale bar. A flat image offers the Color, Background, Bar and Reset buttons and the Contrast and Brightness sliders; the mode buttons, Animate and View are not shown, since the image is always seen face on.

Two lines summarise the file: above the preview in the Legacy interface style, and in the Modern one only with File Information on, above the information sheet, so the preview keeps their room for the image. For an MRC file they give its data type and size — all three dimensions for a map or stack, e.g. Size = 200 x 200 x 120 — and the minimum, maximum, mean and RMS from its header; for a text file, its number of lines and its size. The File Information button at the right of the panel title, next to the file name, replaces the preview with the full information sheet (the panel title changes to File Information); press it again to return to the preview.

The volume viewer

An MRC file with more than one section — a 3D reconstruction, a tomogram, or an image stack such as a focal series — is shown as a volume that can be turned with the mouse. The supported data types are 8-bit, 16-bit signed and unsigned, 32-bit float and 16-bit float (MRC modes 0, 1, 2, 6 and 12). A file the viewer cannot read this way, such as a complex-valued one, is shown as a flat picture of its first section.

When first shown, and after Reset, the volume is seen face on and sized so that its box fills 90 % of the panel's width or of its height, whichever it reaches first; it keeps that size while it turns, so the corners of a cube may pass beyond the edge of the panel until it is zoomed out. The volume sits in an outlined box, whose nearer edges are drawn stronger than the farther ones (the Background button can take the outline away). An axis triad in the lower-left corner shows how the file's x, y and z axes currently point, each labelled with the cell axis it holds; a scale bar sits in the lower-right corner. When the header gives a pixel size, the volume is shown with its true proportions: a stack sampled more coarsely along z than in the plane is drawn correspondingly deeper.

Mouse

ActionEffect
Drag (left button)Turns the volume: dragging right turns its front to the right, dragging down turns it downwards. The volume is rendered at full quality while it turns.
Drag (middle or right button)Moves the volume across the panel: it follows the mouse.
Scroll up or downZooms in and out — with the mouse wheel, a swipe along a touch-surface mouse, or a two-finger slide on a trackpad. A pinch on the trackpad zooms too.
Scroll sidewaysMoves the volume left or right: a tilt of the wheel, or a two-finger slide to the side.
Shift + scrollMoves the volume whichever way it scrolls, up and down included — on a trackpad a free two-finger pan. As with a page, the volume follows the fingers when natural scrolling is on.
Double-clickShows the volume, with all of its controls, full screen on the monitor the panel is on. Double-click again, or press Esc, to bring it back into the panel; selecting another file does the same.

For a 2D MRC image, dragging moves the image instead of turning it, and a double-click opens the image in the MRC browser described below, full screen.

Display modes

Three buttons on the left of the control bar choose how the volume is drawn. The sliders below the buttons change with the mode; each has a readout and a Reset button that returns it to its default.

ModeWhat it showsSliders
Surface (default) The iso-surface at the chosen density level, lit from the upper left, with farther parts drawn darker. Threshold — the surface level, in the units of the file. It spans from the median of the voxel values (the background of a map) to the level that only the brightest 0.05 % of voxels exceed; the default is the mean plus two standard deviations. While the slider is being moved, and for three seconds after it is let go, a histogram of the voxel values is drawn over the top-right third of the volume: the counts on a logarithmic scale across the whole value range, with a vertical bar marking the current level and its value beside it. The background peak and the bright tail of the map are thereby both visible, and the level can be set relative to them. Reset shows the histogram too, with the default level marked.
Denoise — hides specks: every separate piece of the surface smaller than the diameter shown, in all three directions, is left out, while the larger structures are drawn exactly as without. This selects by size; it does not smooth or filter the map. Off at the left; the largest diameter is a quarter of the box's shortest side.
Rotation axis — the axis of the animation (see below).
Projection The maximum value along each line of sight (a maximum-intensity projection). The grey scale covers the upper part of the value range, so that the background noise of a map stays dark. Contrast and Brightness — 50 % is neutral; contrast stretches the grey levels about mid-grey (up to eight times either way), brightness shifts them by up to half the range.
Rotation axis — the axis of the animation.
Z slice One plane through the volume, perpendicular to the viewing direction; its outline where it cuts the box is drawn dashed. Face on, this is a section of the file; after turning the volume with the mouse it is an oblique slice. Height — the position of the plane, from the rear of the box (left) to its front (right); the readout is its distance from the centre, positive towards the viewer. Reset returns to the slice through the centre.
Contrast and Brightness, as for the projection.

A 2D image offers the Contrast and Brightness sliders alone. While one of them is being moved, and for five seconds after it is let go, the histogram of the pixel values is drawn over the top-right third of the image, in the same form as the volume's: the counts on a logarithmic scale across the whole value range. A strip along its foot shows the colour each value is given on the screen under the current settings and colour scheme, and two vertical bars mark the ends of the ramp between them — the values at which the shade reaches its darkest and its brightest, written beside the bars. Values beyond a bar are all shown alike. The Reset button of either slider shows the histogram too, with the neutral ramp marked.

Animation

The Animate button cycles through off, 1x, 2x and 4x, and shows the current speed in its label, e.g. Animate (2x):

The speed is kept in time, not in frames: on a slow computer or a large panel the animation shows fewer frames, but turns just as fast. The volume can still be turned and zoomed with the mouse while it runs. The chosen speed is remembered, so the next 3D file selected starts animating straight away; a 2D image is not animated.

The Rotation axis slider tilts the axis of the turn, from vertical (0°) towards the viewer, until it points straight out of the screen (90°), where the volume spins in the plane of the screen. The axis is fixed on the screen — turning the volume with the mouse does not move it. While the slider moves, and for three seconds after, the axis is drawn over the volume as an arrow.

View buttons

ButtonEffect
ColorShows the current colour scheme in brackets and cycles through seven: Gray, Rainbow, Viridis, Hot, Cool to warm, Ice and White. They colour the intensities of the projection and the slice, and tint the surface; White draws the surface plain white and the intensities in grey.
BackgroundCycles the canvas through black (default) and white, and then black and white again without the box outline around the volume; the triad and scale bar follow the canvas colour. On white, the grey-scale projection is shown as a negative — density dark on a light background.
ViewSwitches between orthographic display (parallel rays, the default) and perspective, in which nearer parts of the volume appear larger.
BarCycles the scale bar through Ångström (default), pixels of the file, and hidden. The Height and Denoise readouts use the same unit. A file whose header gives no pixel size is measured in pixels.
ResetReturns to the face-on view at normal size, centred in the panel with the box filling 90 % of its width or height: X to the right, Y up, Z towards the viewer; a shift of the volume is undone. For a 2D image, shows the whole image at normal size.

When the panel is too narrow for all buttons in one row, Animate, Color, Background, View, Bar and Reset move to a second row.

In the Modern interface style the bar looks different but does the same. The three modes form one segmented control. Color shows the current scheme by name and its colour ramp. Color, Background and Scale bar open a menu of their choices, with the current one checked, instead of cycling on each click. View names the current projection (Orthographic or Perspective), and Reset reads Reset view. The Reset button of each slider is a round arrow.

A preview, not the full data. To stay interactive, the viewer reads a reduced copy of the volume: no axis is longer than 384 voxels (2D images keep up to 2048 pixels), and a larger file is subsampled along each axis by its own step, so that a thin stack keeps all of its sections. Fine detail of a large map may therefore be missing here. Use the Fourier Analyzer or an external viewer (right-click the image in the Images panel) to inspect the full-resolution data.

When another file is selected, the orientation, zoom, threshold and slice position start afresh, and a volume starts as a white surface (the Surface mode with the White colour scheme), however the previous file was shown; the background, view, scale bar, contrast, brightness, denoising diameter, rotation axis and animation speed carry over. A 2D image is always shown in Z-slice mode and orthographic view. The file already shown, loaded again — a script rewrote it and the panel refreshed its results — keeps its display as it is, the mode, orientation, zoom, slice position and surface level included, so that a running animation carries on with the new data.

The MRC browser

A 2D MRC image opens in the MRC browser when it is double-clicked in the File Preview, or in the Images panel above it. The browser fills the monitor the panel is on. At its left is the viewer of the old full-screen browser, with everything that viewer offers: zoom and pan, a magnifier under the left mouse button, the coordinate readout, the colour tool, the menu with all of its functions and keyboard shortcuts (right-click the picture, or the Menu button). At its right is a panel of controls, about a third of a wide screen when the browser opens; the divider between the picture and the panel sets the panel's width, and the display of the local transform and the profile plot follow it. Esc, or the Close button at the foot of the panel, closes the browser. Next to Close, Window leaves the full screen for a window of its own, which first fills the available screen and can then be moved and resized; the button then reads Full screen and takes the browser back (the menu's Show Full Screen, Ctrl+F, does the same). The Dark button in the bottom-right corner shows the panel near-black with bright text, for work in a dark room; the choice is kept between sessions. A file that is a Fourier transform itself (MRC mode 3 or 4) opens straight in the Fourier view.

Display

ControlEffect
Contrast, BrightnessThe window of grey values shown: contrast narrows it from both ends, brightness moves it. 0 is neutral; each slider has a Reset button. The image and its transform keep their own settings. While a slider is moved, and for five seconds after it is let go, the histogram of the grey values is drawn over the top-right third of the picture as in the File Preview: the counts on a logarithmic scale over the whole value range, a strip of the shades the values are shown in, and two bars at the ends of the window with their values.
ColorCycles the colour scheme: grey scale, then the five colour maps of the volume viewer (Rainbow, Viridis, Hot, Cool to warm, Ice).
InvertShows the picture as a negative.
BackgroundThe canvas around the image and under the transform: cycles through black, dark grey and white.
BarA scale bar in the lower right of the image: hidden, in Ångström, or in pixels of the file. Its length follows the zoom. In the Fourier view the resolution ring takes its place.
Reset (right of 1:1)Zooms so that the whole picture, image or transform, fills 95 % of the view, centred, in grey with neutral contrast and brightness. The browser opens the image this way, and shows the transform this way when it first appears.
Pixel sizeThe size of a pixel on the sample, in Ångström, as the file header gives it; when the header has no cell size, the parameter sample_pixel of the project database, and failing that 1 Å. The note beside it says which. It can be edited at any time and sets the scale bar, the resolution scale of the transform, the Thon rings and the profile plot; Save to database in the CTF group writes an edited value to sample_pixel.
Zoom − / + / 1:1Zoom out, zoom in, and one screen pixel per image pixel; the keys , . and the space bar do the same on the picture. The readout shows the zoom.

On the picture, the left button opens the magnifier, a drag with the middle button (or Alt + left button) pans the picture, the right button opens the menu, and the scroll wheel (or a two-finger slide) zooms in and out about the mouse pointer; the wheel does not scroll the picture. The Tools group of the panel opens the coordinate readout (position, value and resolution under the mouse); the Mouse window, which lists what every button, drag and the wheel do in the current mode (the ring and profile drags of the transform included) and follows the mode as it changes; and Screenshot (also the G key), which takes the picture area as shown, with its overlays and without the panel, and asks where to save it as a PNG file. The ? button opens this page. The tool windows belong to the view they were opened on: switching between the image and its transform closes the coordinate readout and the other tool windows of the view that is left.

Fourier transform

ControlEffect
Local FFTWith it on, a square of 200 × 200 image pixels appears in the middle of the view and its Fourier transform in the panel. Hold the left button on the image to move the square, the transform following live; drag with the right button to change its size (right or down enlarges, left or up shrinks it, about its centre; the side is always a multiple of four pixels). The buttons under the display enlarge the centre of the transform and show it whole again, the slider sets its brightness; on the picture, the keys = and - zoom the transform, 1 to 9 set its brightness and 0 shows it whole. The display is hidden again when Local FFT is off.
FFT of the imageComputes the Fourier transform of the whole image and shows it in place of the image, with the Thon rings of the contrast transfer function drawn over it; click again for the image. The transform is of the largest size that fits the image and transforms fast (an even number with no prime factor above 7), so a few rows and columns at the far edges of an awkwardly sized image are left out; the pixel size is unchanged. It is kept as a scratch file in the project's merge/SCRATCH folder while the browser is open. Its amplitudes are shown compressed (the logarithm of the amplitude over the mean amplitude), so that the rings are visible at every resolution; the phases are kept.

Fitting the contrast transfer function

In the Fourier view the Contrast transfer function group fits the defocus of the image to its Thon rings. The microscope and image values the rings are computed with come from the project database and stand in two editable fields at the top of the group: the Voltage (KV) and the spherical aberration Cs (CS, in mm); the phase contrast portion (phacon) is taken from the database as it is, and the pixel size is the one of the Display group. A change in a field redraws the rings at once. The line below the fields says which values were not set in the database, in which case a default is shown (300 kV, 2.7 mm).

ControlEffect
Thon ringsThe zeros of the contrast transfer function over the transform, as ellipses when the image is astigmatic. Click to cycle through three states: solid rings, dotted rings (15° drawn, 15° left out, round each ring, so that the spectrum shows through), and none. The C key hides the rings and brings them back as they were.
Resolution ringA light blue ring at a resolution of your choice, set in the small window that opens; also the R key.
ProfileOn by default: draws a red line from the origin of the transform to its edge and plots the amplitude along it below (see the profile plot). Drag the line to turn it; click the button to hide both.
DefocusThe mean defocus, in Ångström, underfocus positive: a spin box with up and down arrows (steps of 100 Å), with its slider in the row below and a Reset button at the slider's right end that sets 20 000 Å. That is also the value shown until a defocus has been determined for the image (a stored value still equal to the parameter's definition default counts as none).
AstigmatismThe difference of the defocus along the astigmatism axis and across it (x − y), in Ångström; its Reset sets 0.
AngleThe angle of the astigmatism axis from the x axis of the transform, in degrees; its Reset sets 0.
Defocus x, y, angleThe two defocus values and the angle the three settings amount to: what the project stores as defocus.
ReloadThe defocus (the parameter defocus: x, y and the angle), voltage, Cs and pixel size as the project database holds them.
Save to databaseWrites the defocus, astigmatism and angle to the project database (the parameter defocus), and the voltage, Cs and pixel size (KV, CS, sample_pixel) when they were changed in the fields.
The profile plot

With Profile on, as it is when the transform appears, a red line runs from the origin of the transform to its edge. Over the line the cursor becomes a pointing hand; drag it and the line turns with the mouse. A translucent grey wedge about the line, from the origin outwards, shows the region the profile is taken from. The plot under the controls shows the amplitude of the transform along the line (black; one sample per pixel along the line, each the mean round the arc at that radius inside the wedge), against the spatial frequency, with the resolution in Ångström at the ticks. The Stripe width slider under the plot sets the opening angle of the wedge, from 1° to 180° (10° when the browser opens): wider averages more pixels, the more so at higher resolution, and gives a smoother profile; narrower keeps the astigmatism of the rings sharper. The Smoothing slider below it runs a Gaussian along the measured profile, with the sigma shown in pixels of the transform (off at the left, up to 5 in steps of 0.1); the red model curve is not smoothed. The three buttons under the sliders choose what is plotted: Amplitudes (the amplitude of the transform relative to its mean amplitude, with |CTF| in red), Intensities (its square, with CTF²) or ln(1+amplitude/mean) (the form the transform is displayed in, the default, with |CTF|). The axis always ends at the resolution of the corner of the transform, whichever way the line points, so that the scale stays the same as the line turns; the data stop where the line meets the edge. To look at a part of the profile more closely, drag across the plot: the band between the two ends of the drag is then shown alone, its two resolutions in the title of the plot, with the vertical axis fitted to the data within it; a double-click on the plot shows the whole range again. Under the data, in red, is the magnitude of the contrast transfer function along the same line for the defocus set in the panel, scaled to the height of the plot, with its zeros marked by ticks at the foot: when the fit is right, the dips of the black curve fall on the red ticks. The plot follows the sliders, the spin boxes and the dragged rings as they move, and the parameter fields above.

The rings can also be pulled with the mouse. Over a ring the cursor becomes a hand: drag the ring to where the dark ring of the spectrum lies and the defocus follows, so that the ring passes under the cursor; Shift-drag changes the astigmatism instead, and Alt-drag (Option on a Mac) turns the astigmatism axis with the mouse. The spin boxes and sliders follow the mouse, and the mouse follows them. Fit the inner rings first with the defocus, then the elongation of the rings with the astigmatism and its angle.

The rings are drawn at the zeros of the contrast transfer function phacon sin χ + ampcon cos χ, with χ = πλq2 (Δz − ½ Csλ2q2) and ampcon = √(1 − phacon2), which lie at χ = nπ − arccos phacon; the defocus in the direction θ of an astigmatic image is Δz(θ) = ½ (Δzx + Δzy + cos 2(θ − α) (Δzx − Δzy)). These are the equations the viewer has always drawn the rings with.