mr2.data.bart

Reading and writing BART arrays.

BART [BART] stores complex64 arrays either as a pair of files, a text header (.hdr) and the column-major data (.cfl), or as a single raw array file (.ra) [BARTFMT]. These functions do not require BART to be installed.

Notes on using the files with the BART command line:

  • BART expects the name without suffix for .hdr/.cfl pairs, e.g. bart pics kspace sens recon for files written as kspace.cfl and sens.cfl. .ra files are passed with their suffix.

  • bart pics does not accept data along BartDimension.BATCH, the default for flattened other dimensions, and bart ecalib returns a single set of maps for all non-spatial dimensions. Use BART’s loop option, e.g. bart -l 32768 -e <n> pics ... loops over n entries of the batch dimension (flag 1 << 15), or choose other BART dimensions with other_dims.

References

Module Attributes

BART_SUFFIXES

File suffixes of BART arrays.

BART_IMAGE_DIMS

BART dimensions of images (coils, z, y, x) and Cartesian k-space (coils, k2, k1, k0).

BART_NONCARTESIAN_DIMS

BART dimensions of non-Cartesian k-space samples (coils, readouts, k0).

BART_TRAJECTORY_DIMS

BART dimensions of non-Cartesian trajectories (readouts, k0, kxyz).

Functions

check_distinct_outputs(*filenames)

Raise an error if BART files with these names would overwrite each other.

from_bart_layout(data, trailing_dims[, ...])

Arrange a tensor in BART dimension order as MR2 tensor.

is_bart_file(filename)

Check if a filename refers to a BART array by its suffix.

read_bart(filename)

Read a BART array.

to_bart_layout(data, trailing_dims[, other_dims])

Arrange an MR2 tensor in BART dimension order.

write_bart(filename, data)

Write a tensor as BART array.