MRC2014

MRC/CCP4 2014 file format

This page gives the detailed specification of the MRC2014 format, as published by Cheng et al. (2015). For other versions of the MRC format and an overview of the format update process, see the parent page.

CCP-EM maintain a Python library for reading, writing and validating MRC2014 files.

Main header

Length = 1024 bytes, organized as 56 4-byte words followed by space for 10 80-byte text labels.

WordBytesVariable nameDescriptionNote
11-4NX or NCnumber of columns in 3D data array (fast axis)1
25-8NY or NRnumber of rows in 3D data array (medium axis)
39-12NZ or NSnumber of sections in 3D data array (slow axis)
413-16MODE0 8-bit signed integer (range -128 to 127)
1 16-bit signed integer
2 32-bit signed real
3 transform : complex 16-bit integers
4 transform : complex 32-bit reals
6 16-bit unsigned integer
12 16-bit float (IEEE754)
101 4-bit data packed two per byte
2
517-20NXSTART or NCSTARTlocation of first column in unit cell
621-24NYSTART or NRSTARTlocation of first row in unit cell
725-28NZSTART or NSSTARTlocation of first section in unit cell
829-32MXsampling along X axis of unit cell
933-36MYsampling along Y axis of unit cell
1037-40MZsampling along Z axis of unit cell3
11-1341-52CELLAcell dimensions in angstroms
14-1653-64CELLBcell angles in degrees
1765-68MAPCaxis corresp to cols (1,2,3 for X,Y,Z)4
1869-72MAPRaxis corresp to rows (1,2,3 for X,Y,Z)
1973-76MAPSaxis corresp to sections (1,2,3 to X,Y,Z)
2077-80DMINminimum density value5
2181-84DMAXmaximum density value
2285-88DMEANmean density value
2389-92ISPGspace group number6
2493-96NSYMBTsize of extended header (which follows main header) in bytes7
25-4997-196EXTRAextra space used by anything – 0 by default
27105EXTTYPcode for the type of extended header8
28109NVERSIONversion of the MRC format9
50-52197-208ORIGINphase origin (pixels) or origin of subvolume (A)10
53209-212MAPcharacter string ‘MAP’ to identify file type
54213-216MACHSTmachine stamp encoding byte ordering of data11
55217-220RMSrms deviation of map from mean density
56221-224NLABLnumber of labels being used
57-256225-1024LABEL(20,10)10x 80 character text labels

Extended header

In the original definition, the extended header holds space group symmetry records stored as text as in International Tables, operators separated by * and grouped into ‘lines’ of 80 characters (ie. symmetry operators do not cross the ends of the 80-character ‘lines’ and the ‘lines’ do not terminate in a *). The extended header is now used by different software to hold various additional metadata instead, as indicated by the EXTTYP tag.

Data block

A list of data values representing the image/map/volume itself. The data type is defined by the MODE keyword in the main header (see above). The data items form a 3-dimensional grid, organised into columns, rows and sections (see keywords NX, NY, NZ in main header). The orientation of the grid with respect to the coordinate system is set by keywords MAPC, MAPR, MAPS in the main header. The 3-dimensional grid may represent a stack of images or a stack of volumes, see note above.

Handedness

The handedness of the data block is not well defined by the MRC2014 standard. Conventionally, many pieces of software have treated the data as right-handed, with the origin in the bottom left corner of a 2D image and the Z-axis pointing out of the screen.

However, this approach is not universal, and some packages treat the data block as left-handed. An example is FEI’s EPU data acquisition software, which places the image origin in the top left, as documented in appendix C of the EPU User Manual.

Proposals for indicating the data handedness in the file header are under discussion, but for now, the only way to be sure of the handedness is to check the behaviour of each software package individually.

Notes

Note †

The variable name is not used in the file format and so is arbitrary. There are standard names that are typically encountered in software and documentation, and we list the common ones. Often they are referred to differently in EM and crystallography.

Note 1

The data block of an MRC format file holds a 3D array of data (of type specified by MODE). NC, NR, NS specify the dimensions (in grid points) of this array, orientated according to MAPC/MAPR/MAPS. In EM, this will correspond to the dimensions of a volume/map, or the combined size of an image/volume stack. In crystallography, this will correspond to the dimensions of a map, which may cover a crystallographic unit cell or may cover some fraction or multiple of a unit cell.

Note 2

In the MRC2014 format, Mode 0 has been clarified as signed, and mode 6 has been added for 16-bit unsigned integer data. See updates page for additional modes.

Note 3

In crystallographic usage, MZ represents the number of intervals, or sampling grid, along Z in a crystallographic unit cell. This need not be the same as NZ (or NX/NY if axes permuted) if the map doesn’t cover exactly a single unit cell. For microscopy, where there is no unit cell, MZ represents the number of sections in a single volume. For a volume stack, NZ/MZ will be the number of volumes in the stack. For images, MZ = 1.

Note 4

In EM MAPC,MAPR,MAPS = 1,2,3 so that sections and images are perpendicular to the Z axis. In crystallography, other orderings are possible. For example, in some spacegroups it is convenient to section along the Y axis (i.e. where this is the polar axis).

Note 5

Density statistics may not be kept up-to-date for image/volume stacks, since it is expensive to recalculate these every time a new image/volume is added/deleted. We have proposed the following convention: DMAX < DMIN, DMEAN < (smaller of DMIN and DMAX), RMS < 0 each indicate that the quantity in question is not well determined.

Note 6

Spacegroup 0 implies a 2D image or image stack. For crystallography, ISPG represents the actual spacegroup. For single volumes from EM/ET, the spacegroup should be 1. For volume stacks, we adopt the convention that ISPG is the spacegroup number + 400, which in EM/ET will typically be 401.

Note 7

NSYMBT specifies the size of the extended header in bytes, whether it contains symmetry records (as in the original format definition) or any other kind of additional metadata.

Note 8

A code for the kind of metadata held in the extended header. Currently agreed values are:

CCP4Format from CCP4 suite
MRCOMRC format
SERISerialEM. Details in the IMOD documentation.
AGARAgard
FEI1 & FEI2Used by Thermo Scientific and FEI software, e.g. EPU and Xplore3D, Amira, Avizo. Details can be found in this specification document, which is also available from the ThermoFisher software center.
HDF5Metadata in HDF5 format

Note 9

The version of the MRC format that the file adheres to, specified as a 32-bit integer and calculated as:
     Year * 10 + version within the year (base 0)
For the original MRC2014 format, the value was 20140, while the latest update is 20141.

Note 10

For transforms (Mode 3 or 4), ORIGIN is the phase origin of the transformed image in pixels, e.g. as used in helical processing of the MRC package. For a transform of a padded image, this value corresponds to the pixel position in the padded image of the centre of the unpadded image.

For other modes, ORIGIN specifies the real space location of a subvolume taken from a larger volume. In the (2-dimensional) example shown above, the header of the map containing the subvolume (red rectangle) would contain ORIGIN = 100, 120 to specify its position with respect to the original volume (assuming the original volume has its own ORIGIN set to 0, 0).

Note 11

Bytes 213 and 214 contain 4 `nibbles’ (half-bytes) indicating the representation of float, complex, integer and character datatypes. Bytes 215 and 216 are unused. The CCP4 library contains a general representation of datatypes, but in practice it is safe to use 0x44 0x44 0x00 0