mrc — the MRC/CCP4 volumetric data format

New in version 0.7.0.

Reading of MRC/CCP4 volumetric files (MRC2014 file format) using the mrcfile library [Burnley2017].

References

Burnley2017

Burnley T, Palmer C and Winn M (2017) Recent developments in the CCP-EM software suite. Acta Cryst. D73:469-477. doi: 10.1107/S2059798317007859

Classes

class gridData.mrc.MRC(filename=None)[source]

Represent a MRC/CCP4 file.

Load MRC/CCP4 2014 3D volumetric data with the mrcfile library.

Parameters

filename (str (optional)) – input file (or stream), can be compressed

Raises

ValueError – If the unit cell is not orthorhombic or if the data are not volumetric.

header

Header data from the MRC file as a numpy record array.

Type

numpy.recarray

array

Data as a 3-dimensional array where axis 0 corresponds to X, axis 1 to Y, and axis 2 to Z. This order is always enforced, regardless of the order in the mrc file.

Type

numpy.ndarray

delta

Diagonal matrix with the voxel size in X, Y, and Z direction (taken from the mrcfile.mrcfile.voxel_size attribute)

Type

numpy.ndarray

origin

numpy array with coordinates of the coordinate system origin (computed from header.origin, the offsets header.origin.nxstart, header.origin.nystart, header.origin.nzstart and the spacing delta)

Type

numpy.ndarray

rank

The integer 3, denoting that only 3D maps are read.

Type

int

Notes

  • Only volumetric (3D) densities are read.

  • Only orthorhombic unitcells supported (other raise ValueError)

  • Only reading is currently supported.

New in version 0.7.0.

property edges

Edges of the grid cells, origin at centre of 0,0,0 grid cell.

Only works for regular, orthonormal grids.

histogramdd()[source]

Return array data as (edges,grid), i.e. a numpy nD histogram.

read(filename)[source]

Populate the instance from the MRC/CCP4 file filename.

property shape

Shape of the array