-
Geometric operations
The most used operations on images involve the geometric transformations, translation, rotation and scaling. The programs in Bsoft are designed to give the user full control over all aspects, but that comes with a requirement to understand the conventions.
Because the origin is very important, the origins in a map can be examined using:
bhead -verb 7 -info emd_0407.map
The main program to do geometric operations is bint (interpolation).
To translate the map, type the following command:
bint -verb 7 -ori cen -trans -100,100,0 emd_0407.map emd_0407_t.mrc
The “-origin” option sets the origin to the center of the map. This is important, because most operations depend on how it is set. The “-translate” option moves the map by the indicated number of voxels. In this case, it moves it to the upper left corner, cutting of part of the density. Also note that the origin has been adjusted to reflect this move.
The origin is particularly important for rotations, because it specifies the center of rotation.
To rotate the map, type the following command:
bint -verb 7 -ori cen -rotate 0,0,1,33 emd_0407.map emd_0407_r.mrc
The rotation is specified by a 3-value rotation axis [in this case, the z-axis (0,0,1)], and a rotation angle in degrees.
To change the map scale, type the following command:
bint -verb 7 -ori cen -scale 0.5,0.5,0.5 -size 128,128,128 -trans -64,-64,-64 emd_0407.map emd_0407_s.mrc
As with rotation, the change in scale is around the origin. This means that if we want to fit it into a smaller size, we also must translate it correctly. The result of this command line now has the origin in the center of the new map, and the sampling is twice the original. All three transformations can be done at the same time.
-
Binning
Images are often rescaled by binning, a form of rescaling by integer factors.
The most common is binning by 2, i.e., averaging every 2 × 2 pixels, or 2 × 2 × 2 voxels:
bint -verb 7 -bin 2 emd_0407.map emd_0407_b2.mrc
This binning is isotropic, but anisotropic binning can also be done, by specifying the bin factor for every dimension.
-
Density operations
Image processing is about manipulating the data in images. Some of the simple operations changes the density distributions, with the goal of eliminating problems, or setting a distribution with specific features. The program bimg has options to truncate the data (eliminate values above and below thresholds), or set the minimum and maximum to desired values.
An operation extensively used throughout Bsoft is to set the average to zero, and the standard deviation to one:
bimg -verb 7 -ori cen -rescale 0,1 emd_0407.map emd_0407_rs.mrc
Now the density distribution is well defined, many subsequent operations will work well.
The micrographs of cryoEM show the biomolecules as dark on a slightly lighter background, i.e., lower values indicate density (also referred to as negative density). When it comes to interpreting the density, the intuition is to have higher values indicating greater density (i.e., positive density). The map of our example was deposited in the EMDB as a positive density map. To see what the original reconstructed map looks like corresponding to the density seen in micrographs, the map must be inverted (Figure 6A):
bimg -verb 7 -ori cen -invert emd_0407.map emd_0407_i.mrc
Sometimes, the extreme values in an image are very large and do not contribute to the information content.
The extremes can be modified by truncation to more reasonable values, or to enhace the display contrast:
bimg -verb 7 -trunc -0.05,0.05 emd_0407.map emd_0407_tr.mrc
Images can also be adjusted by simple manipulations, such as shifting the density values by adding a constant, or multiplying the density values by a constant:
bar -verb 7 -add 0.1 -mult 10 emd_0407.map emd_0407_am.mrc
-
Color
Bsoft supports various image formats that can store color encoding (TIFF, JPEG, PNG, or GRD). Color is often used to better show differences in a map.
One conversion is to a red-blue transition (Figure 6B):
bcolour -verb 7 -verb 7 -rwb -10,-0.1,0.1,10 emd_0407_rs.mrc emd_0407_rs_rwb.tif
Note that the origin is (0,0,0), because the TIFF format does not include fields for specifying it.

Figure 6. Manipulating map emd_0407.
(A) Inverted map. (B) A red-blue colored map.
-
Adding images
There are various programs to add images to each other.
If the images are within one file, these can be summed with:
bimg -verb 7 -images -sum emd_0407.map emd_0407_sum.mrc
Note that here we interpreted the slices of the 3D volume as individual 2D images. The result is a projection of the map in the z-direction (see later for more on projections). The -average option is the same as the sum, except that it divides the result by the number of original images.
In cryoEM, we usually produce two “half maps”, each calculated from independent halves of the original data set.
To sum the two half maps from the example, do:
bop -verb 7 -add 1,0 emd_0407_half_map_1.map emd_0407_half_map_2.map emd_0407_full.map
If we want to add multiple images in different files, we can use wildcards (“?” and “*”) to specify a set of files:
badd -verb 7 -out emd_0407_sum.mrc emd_0407_half_map_?.map
-
Multiplying images
The most common reason in cryoEM for multiplication of images is to apply a mask.
In our example, we can multiply the map with the provided mask:
bop -verb 7 -mult 1,0 emd_0407.map ../masks/emd_0407_msk_1.map emd_0407_masked.mrc
-
Difference images
If we have maps from different sample compositions, we often want to see the difference in the maps.
The simplest comparison is to subtract the one from the other:
bop -verb 7 -add -1,0 emd_0407_half_map_1.map emd_0407_half_map_2.map emd_0407_dif.map
Note that, in this case, the maps are at relatively high resolution, so that the difference map does not show much beyond noise.
-
Constructing images
Sometimes we want to generate a synthetic image to use as reference or mask. The simplest approach is to place fuzzy spheres into a volume.
As an example, let us place a sphere into a box:
beditimg -v 7 -create 100,100,100 -origin 50,50,50 -sphere 35,35,38,12 -edge 3 -fill 1 spot1.mrc
The sphere is now located at voxel (35,35,38), with a radius of 12 voxels, and a soft edge of 3 voxels. The “-fill” option is required, to specify the extreme value within the sphere (otherwise the image will just be empty).
We can add another sphere:
beditimg -v 7 -sphere 21,40,38,2 -edge 1 -fill 1 spot1.mrc spot2.mrc
If the intended image has symmetry, we can apply that (Figure 7):
bsym -verb 7 -sym D5 spot2.mrc d5.mrc

Figure 7. A synthetic map composed of two spheres with D5 symmetry imposed.
-
Images with random content and noise
Several types of random images can be generated.
The simplest is a uniform distribution (Figure 8A):
brandom -verb 7 -size 256,256,1 -type uni uniform.mrc
In cryoEM, the data mostly conforms to a Poisson distribution, also called shot or quantum noise (Figure 8B):
brandom -verb 7 -size 256,256,1 -type pois -avg 3 poisson.mrc
At larger averages, Poisson distributions approach Gaussian distirbutions.
To generate a Gaussian distribution, do (Figure 8C):
brandom -verb 7 -size 256,256,1 -type gaus -avg 9,3 gauss.mrc
A Gaussian distribution is also called white noise, because its spectral distribution approaches a constant power.
To generate a random image with a different spectral distribution, such as for brown noise, do (Figure 8E):
brandom -verb 7 -size 256,256,1 -type spec -alpha 2 brown.mrc
To generate pink noise (Figure 8D), set the alpha value to 1, and for blue noise (Figure 8F), set it to -1.

Figure 8. Random images.
(A) Uniform. (B) Poisson/Shot/Quantum noise. (C) Gaussian/White noise. (D) Pink noise. (E) Red/Brown noise. (F) Blue noise.
-
Point group symmetry
The symmetries of isolated biomolecules we deal with in cryoEM are mostly point group symmetries. The five classes of point group symmetries are shown in Figure 9A. Various symbols have been used for the symmetries, with the ones shown adopted in Bsoft.
As an example, the icosahedral map was created as follows:
beditimg -v 7 -create 100,100,100 -origin 50,50,50 -sphere 33,33,38,8 -edge 3 -fill 1 spot1.map
beditimg -v 7 -sphere 19,38,38,2 -edge 1 -fill 1 spot1.map spot2.map
bsym -verb 7 -sym I spot2.map ico.map
-
Helical symmetry
Helical filaments have their own symmetry. The fundamental symmetry of any helix can be expressed as a rise, and a rotation per subunit.
The first helix shown in Figure 9B was created as follows:
beditimg -v 7 -create 200,200,200 -ori 100,100,100 -sam 2 -sph 110,100,100,10 -fill 1 -edge 2 sph1.map
beditimg -v 7 -sph 120,110,100,2 -fill 1 -edge 2 sph1.map sph2.map
bhelix -v 7 -helix 40,66 -zlim 180,220 sph2l2.map hel2.map
bimg -v 7 -size 200,200,400 -trans 0,0,100 sph2.map sph2l2.map
bhelix -v 7 -helix 40,66 -zlim 180,220 sph2l2.map hel2.map
In addition, a helix can have further symmetries or features. The first is a dyad axis, which indicates that the two directions of the helix are 2-fold symmetry-related. The second is that it can have cyclic symmetry, typically with multiple protofilaments contributing to a composite helix. Figure 9B shows such a helix with five protofilaments on the right.
It was generated from the sph2l2.map created above, as follows:
bint -verb 7 -trans 10,0,0 -newori center sph2l2.map sph2l2t.mrc
bhelix -v 7 -helix 40,66,1,5 -zlim 180,220 sph2l2t.mrc hel2c5.mrc
(A) Point group symmetry: C5: 5-fold cyclic; D5: 5-fold dihedral; T: tetrahedral; O: octahedral; I: icosahedral. The models show the corresponding platonic solids: tetrahedron, cube, octahedron, dodecahedron, and icosahedron. (B) Helical symmetry: Left: H40,66 (rise of 40Å, rotation of 66°); Right: H40.66,1,5 (rise of 40Å, rotation of 66°, no dyad, cyclic 5-fold).