Examples

Examples#

Executed when the documentation is built: every figure and number comes from the code on the page. Each page has an Open in Colab button, so you need nothing but a browser to run it. The ideas behind them are in Explanations, and every function they call is in API reference.

Course#

Eleven lessons from a k-space tensor to a learned reconstruction, read in order (Course).

Lesson

Contents

1. Your data as tensors

Tensors in BART’s layout; BART commands on tensors

2. From k-space to an image

Undersampled Cartesian reconstruction, step by step

3. Coil sensitivities

Coil sensitivity estimation and its effect on the reconstruction

4. Joint reconstruction of image and sensitivity maps

Joint estimation of image and coil sensitivities from a small calibration region

5. Choosing a regularizer

Tikhonov, wavelet and total-variation regularization; regularization weight

6. Custom encoding and solver

Encoding operator and solver, identical to pics

7. Basics of non-Cartesian imaging

Trajectories, NUFFT, density compensation, point spread function

8. Radial SENSE

Golden-angle radial SENSE

9. Nonlinear inversion for T2 mapping

Model-based \(T_2\) mapping from raw data

10. Plug-and-play reconstruction

Plug-and-play with a pretrained denoiser

11. Training an unrolled network

Unrolled network trained through ADMM

Tours#

Standalone examples beyond the Course. Each names the lessons it assumes (Tours).

Tour

Contents

Readout oversampling and apodization

Readout oversampling removal; Fermi and Hann apodization

EPI Nyquist ghost and ramp sampling

EPI Nyquist ghost correction; ramp-sampling regridding

Receive bias field

Receive bias field estimation with N4

Gradient nonlinearity

Gradient nonlinearity correction from spherical-harmonic coefficients

Off-resonance correction of spiral imaging

Spiral off-resonance deblurring: multifrequency interpolation, time-segmented reconstruction

Rigid head motion from navigators

Rigid head motion from orthogonal navigator planes

Susceptibility distortion in EPI

EPI susceptibility distortion correction from reversed phase encoding

Noise prewhitening

Noise prewhitening and SNR

Dynamic golden-angle radial MRI

Dynamic golden-angle radial reconstruction with temporal total variation

Subspace-constrained T1 mapping

Subspace \(T_1\) mapping from a continuous inversion-recovery scan

Parameter maps from scanner images

\(T_2\) mapping from DICOM magnitude images

Networks for complex volumes

Networks for complex multi-contrast volumes; patchwise execution

Staged training of an unrolled network

Staged training of unrolled networks

Training without a reference

Self-supervised training from undersampled data

Annealed plug-and-play

Plug-and-play with an annealed noise level

Uncertainty estimation

Calibrated voxel-wise uncertainty

Requirements#

The scripts need a built bartorch, brainweb-dl, which downloads the BrainWeb phantoms several examples build their images from, and matplotlib and cmap for the figures:

pip install bartorch brainweb-dl matplotlib cmap

The learned-regularization lessons and tours additionally require lightning, torchio, monai and deepinv, and the corrections tours PyHySCO; the Course and Tours pages name what each needs.