This repository contains code to perform low-rank MR-MOTUS reconstructions similar to the ones described in
- Nonrigid 3D motion estimation at high temporal resolution from prospectively undersampled k‐space data using low‐rank MR‐MOTUS, by Huttinga NRF, Bruijnen T, van den Berg CAT, Sbrizzi A.
The code relies on the following toolboxes:
- Non-uniform FFT computations with the FINUFFT toolbox by Alex H Barnett et al;
- MATLAB L-BFGS-B-C wrapper by Stephen Becker;
- BART toolbox by Uecker et al.
The FINUFFT and L-BFGS-B-C toolboxes are provided in this repository with Linux precompiled MEX-files, but the BART toolbox must be installed beforehand. It may be necessary to recompile the FINUFFT and/or L-BFGS-B toolboxes, depending on your system.
The 3D+t and full pipeline examples (2D and 3D) require large datasets that can be downloaded from here, or can be downloaded by running the following lines in the terminal (Linux/Mac):
cd LowRank_MRMOTUS
bash ./download_data.sh
The following examples show minimal code that performs low-rank MR-MOTUS reconstructions. Typical steps in these reconstructions are
- Load data and reconstruction parameters
- Recostruction motion-fields with low-rank MR-MOTUS
- Visualize all results
To perform a 2D+t low-rank MR-MOTUS reconstruction on the 2D golden-angle (2DGA) radial data, run
run('2DGA/Motion recon/Main_2DGA.m')
This script relies on all parameters and paths set in "2DGA/Motion recon/Parameters_2Dt_RespMotion.m", make sure these are set correctly.
To perform a 3D+t reconstruction on the 3D golden-mean radial (3DGMR) data, run
run('3DGMR/Motion recon/Main_3DGMR.m')
This script relies on all parameters and paths set in "3DGMR/Motion recon/Parameters_3Dt_RespMotion.m", make sure these are set correctly.
The following examples show minimal code that performs the full reconstruction pipeline from raw data to motion-fields:
- Load data into Matlab
- Set parameters for reference image reconstruction
- Estimate coil compression coefficients for linear homogeneous coil compression
- Extract surrogate signal
- Respiratory binning
- Reconstruct two reference images (low resolution for MR-MOTUS reconstruction, high resolution for visualization)
- Save the result of step 1-6 in a single struct
- Run low-rank MR-MOTUS reconstructions
For the 2D golden-angle data, the complete pipeline can be performed as
run('2DGA/Preprocessing/Preprocess_and_RefImage_2DGA.m') # perform steps 1-7
run('2DGA/Motion recon/Main_2DGA.m') # preform step 8
Make sure all paths and parameters in the beginning of "2DGA/Preprocessing/Preprocess_and_RefImage_2DGA.m" and "2DGA/Motion recon/Parameters_2Dt_RespMotion.m" are set correctly.
For the 2D golden-angle data, the complete pipeline can be performed as
run('3DGMR/Preprocessing/Preprocess_and_RefImage_3DGMR.m') # perform steps 1-7
run('3DGMR/Motion recon/Main_3DGMR.m') # preform step 8
Make sure all paths and parameters in the beginning of "2DGA/Preprocessing/Preprocess_and_RefImage_3DGMR.m" and "3DGMR/Motion recon/Parameters_3Dt_RespMotion.m" are set correctly. Note: these reconstructions may take around 30 minutes, depending on your computing power. It is therefore recommended to experiment with 2D reconstructions.
- To run this code on your own data all raw data should first be stored in a
struct
'DataStruct', with the following structure:
DataStruct
.RawKspaceData
- complex matrix of size [#readoutsamples x #readouts x 1 x #coils].Coordinates
- real matrix of size [#spatialdims x #readoutsamples x #readouts x #coils].Coils
.Sensitivities
- complex matrix of size [#ImDim1 x #ImDim2 x #ImDim3 x #coils].Noise_covariance
- complex matrix of size [#coils x #coils] (can be set to identity)
- Copy and edit the parameter file for reference image reconstruction, make sure it points to the 'DataStruct' with raw data above (e.g. '2DGA/Preprocessing/ref_im_parameters_2DGA.m')
- Copy and edit the main preprocessing script to include your new parameter file (e.g. '2DGA/Preprocessing/Preprocess_and_RefImage_2DGA.m')
- Run the main preprocessing script (e.g. '2DGA/Preprocessing/Preprocess_and_RefImage_2DGA.m')
- Copy and edit the parameter file for motion reconstructions (e.g. '2DGA/Motion recon/Parameters_2Dt_RespMotion.m')
- Copy and edit the main motion recon script to include your parameter file and preprocessed data (e.g. '2DGA/Motion recon/Main_2DGA.m')
- Run the main motion recon script (e.g. '2DGA/Motion recon/Main_2DGA.m')