CS MoCo LAB: An MR acquisition and reconstruction system

This software allows to generate a Compressed Sensing (CS) accelerated MR sequence and to reconstruct the acquired data online on the scanner by means of Gadgetron online on the scanner or via Gadgetron or Matlab offline on an external workstation. The following features are included:

    • Subsampling
    • Gaussian
    • Poisson-Disc
    • ESPReSSo
    • reconstruction algorithm
    • FOCal Underdetermined System Solver (FOCUSS)
  • Berkeley Advanced Reconstruction Toolbox (BART)
  • sparseMRI
  • SPIRiT/ESPIRiT
  • L1-Magic
    • Fast Composite Splitting Algorithm (FCSA)
    • Alternating Direction Method of Multipliers (ADMM)
    • Split Bregman
    • regularizer
    • l1: sparsifying transformation (Wavelet, FFT, DCT, PCA, Mellin, Surfacelet)
    • Group Sparsity
    • total variation (TV), non-local total variation (NLTV)
    • ESPReSSo
    • Parallel Imaging calibration

Overview

There are two CS LAB system setups:

- online: for direction reconstruction on the scanner

- offline: for retrospective reconstruction on an external workstation

A documentation of the CS LAB can be found here: Documentation

online CS LAB

The CS_LAB_Gadget can be directly used inside Gadgetron.

Further information about Gadgetron can be found here: https://gadgetron.github.io/

An installation guide for setting it up, can be found here: Gadgetron

offline CS LAB

For analysis purposes, the are two offline options available:

a1) C++ (as library)

The CS_LAB_Gadget can be called without the use of Gadgetron as a standalone program (if data is provided in ISMRMD format).

Check API (below) for integration. To compile and use the CS_LAB_Gadget library, you have to install the required packages.

a2) C++ (via Matlab)

The CS_LAB_Gadget can be called from Matlab via CS_LAB_Interface.cpp (mex file).

If the precompiled mex files are not working, you have to install the required libraries and run:

mex CS_FOCUSS.cpp -Iinclude\gadgetron -Iinclude\cuda -Isrc\FOCUSS -Iinclude\fftw -Iinclude -Llib\boost -Llib\ace -lACE -Llib\CS_LAB -lCS_LAB

b) Matlab

Matlab implementation of the CS LAB acquisition and reconstruction code.

Download

Stable release:

Source codes are available at GitHub: https://github.com/thomaskuestner/CS_MoCo_LAB

Please cite one of the papers, if you use it in a scientific publication.

Prerequisites

online CS LAB

subsampling code: Include code into acquisition sequence

C++ code: In order to set up the Gadgetron system, please see: Gadgetron

offline CS LAB

subsampling code: Compile acquisition C++ code via

g++ -std=c++0x -fopenmp Approx.cpp LinkedList.cpp Point.cpp SomeFunctions.cpp SubsampleMain.cpp VDSamplingUpper.cpp VariableDensity.cpp -o Subsample

C++ code: The usage of the C++ code requires additional libraries, see: Gadgetron prerequisites

Matlab code: The Matlab code may require a recompilation of mtimesx (in CS_LAB_matlab/utils/utils_TRAFO/PCA; see compileInstructions.txt), BART (in CS_LAB_matlab/utils/utils_BART; follow BART compile instructions)

Integration

Acquisition

A generic C++ code is provided to perform the CS subsampling: https://github.com/thomaskuestner/CS_LAB/tree/master/acquisition/subsampling_class

Furthermore, an exemplary precompiled spoiled gradient echo sequence, named CS_FLASH (Siemens, VB20P) is added: https://github.com/thomaskuestner/CS_LAB/tree/master/acquisition/CS-FLASH/VB20P

Subsampling

The generic subsampling class provides different subsampling distributions (Gaussian, Poisson-Disc) with or without variable-density, elliptical scanning, fixed central calibration region and ESPReSSo compactification with the following options:

>> Subsampling -h
============================================================================================================
--- Subsampling Mask Generation ---
============================================================================================================
 input parameters in ascending order (just numbers) with [default value] if left blank:
 no input parameters allows them to be entered in the command window
 
 parameter [defVal]            description                                                     possible values
------------------------------------------------------------------------------------------------------------
 nX [256]:                     width of subsampling mask                                       [16:1024]
 nY [128]:                     height of subsampling mask                                      [1:1024]
 accel [3]:                    desired acceleration factor                                     [2:15]
 subsampling type [1]:         Poisson-Disc {1}, Gaussian {2}                                  {1,2}
 fully sampled [0.065]:        percentage of fully sampled region                              [0:1]
 elliptical scanning [0]:      sample in elliptical scan region                                {0,1}
 ESPReSSo factor [1]:          ESPReSSo/Partial Fourier compactification factor                [0.5:1]
 ESPReSSo direction [0]:       ESPReSSo/Partial Fourier direction along width {0}, height {1}  {0,1}
 variable-density [4]:         variable-density options                                        {1,2,3,4,5}
                                  none {1}
                                  central point {2}
                                  central block {3}
                                  central ellipse {4}
                                  local adaptive variable-density (needs external fraction.txt file) {5}
 Poisson Sampling [1]:         Poisson-Disc sampling options                                    {0,1,2}
                                  2D Poisson-Disc {0} (chosen automatically if nY=1)
                                  3D Poisson-Disc {1} (strictly obeying neighbourhood criterion)
                                  3D pseudo Poisson-Disc {2} (approximately obeying neighbourhood criterion)
 power [2]:                    power of variable-density scaling                                [1:5]
 root [2]:                     root of variable-density scaling                                 [1:5]

online CS LAB

The code can easily be implemented in any sequence.

An exemplary Cartesian subsampling along ky and kz is shown here:

long lLines = 256;             // ky size
long lPartitions = 64;         // kz size
double dAccel = 4;             // desired subsampling acceleration
float fully_sampled = 0.065;   // percentage fully sampled center region
float ESPReSSoVal = 1;         // ESPReSSo compactification factor
bool ESPReSSoDir = false;      // ESPReSSo direction (ky = false, kz = true)
long lMeasurements = 1;        // temporally changing subsampling mask
short int varDensity = 4;      // variable-density type
short int smpl_type = 1;       // Poisson-Disc subsampling algorithm
bool ellipScanning = false;    // elliptical scanning
long lLine, lPartition, lMeasurement;
// Poisson-Disc subsampling
int*** subsamplingMask = SubsampleMain::startPD(lLines, lPartitions, dAccel, fully_sampled, ESPReSSoVal, ESPReSSoDir, lMeasurements, varDensity, smpl_type, ellipScanning);
// Gaussian subsampling
//int*** subsamplingMask = SubsampleMain::startGaussian(lLines, lPartitions, dAccel, fully_sampled, ESPReSSoVal, ESPReSSoDir, lMeasurements);
for(lMeasurement = 0; lMeasurement < lMeasurements; lMeasurement++)
{
    for(lLine = 0; lLine < lLines; lLine++)
    {
        for(lPartition = 0; lPartition < lPartitions; lPartition++)
        {
            if(subsamplingMask[lLine,lPartition,lMeasurement] > 0)
                // run sequence kernel
        }
    }
}

offline CS LAB

The compiled acquisition C++ code can also be called as a standalone program (e.g. from command line):

Subsample[.exe] lLines lPartitions dAccel subSampleDistribution fully_sampled ellipScanning ESPReSSoFac ESPReSSoDir varDensity

Reconstruction

The reconstruction can be carried out via C++: https://github.com/thomaskuestner/CS_LAB/tree/master/reconstruction/c++

or via Matlab: https://github.com/thomaskuestner/CS_LAB/tree/master/reconstruction/matlab

C++

The Compressed Sensing reconstruction is carried out in the CS_LAB_Gadget (CS_LAB.lib, CS_LAB.dll) which can be linked into Gadgetron or called from other code if data is provided in ISMRMD format with the following API:

CS_LAB *pCS = new CS_LAB();
pCS->process_config(XML_FILE);
int iRet = pCS->opCS_->fRecon(hoArray, hoArray); // hoArray in ISMRMD format

Parametrization:

The CS_LAB_Gadget is parametrized via an XML file (CS_LAB.xml) of the following structure:

<gadget>
<name>FOCUSS</name>
<dll>CS_LAB</dll>
<classname>CS_LAB</classname>
<property>
    <name>PARAMETER_NAME</name>
    <value>PARAMETER_VALUE</value>
</property>
...
</gadget>

The input parameters are:

The sparsifying transformations can be flexibly combined, e.g.: FFT along x, PCA along y+z.

The CS_Gadget can also be called from Matlab. See example code

CS_LAB_Interface.m

for more information. The reconstruction parametrization is extracted from the XML file (CS_LAB.xml).

Matlab

A GUI (CS_LAB_GUI) enables smooth access to the Matlab implementation (reconstruction code may also be called directly).

Datasets (subsampled/accelerated or fully sampled/non-accelerated) can be loaded in (mat files) and processed in the CS_LAB reconstruction code.

The mat files must contain the variables:

kSpace (subsampled or fully sampled)
    cell array: nSlices x nChannels x nRepetitions x nAverages
    each cell: 2D: nYPhase x nXFreq x    -    x (nTime) (single/double array)
               3D: nYPhase x nXFreq x nZPhase           (single/double array)
               4D: nYPhase x nXFreq x nZPhase x nTime   (single/double array)
// if subsampled kSpace
mask (subsampling mask)
    double/logical array: nSparseDim1 x nSparseDim2 (1D pattern: nSparseDim2 = 1, 2D pattern: nSparseDim2 > 1)
sparseDim (sparse dimensions)
    double array: [Dim1, Dim2] (Dim-i: matrix dimension along which subsampling occurs, e.g. for 3D kSpace: [1 3] := [yPhase, zPhase])

If the kSpace was prospectively subsampled, the kSpace or zero-padded image can be shown in the upper left and the mask is shown in the lower left of the GUI.

For retrospective subsampling of non-accelerated datasets, the GUI calls the subsampling code (Subsampling) with the set parameters from the GUI.

The reconstruction algorithm, sparsifying transformation and sparsifying dimensionality can be set in the GUI.

The sparsifying dimensionality can e.g. be set for a 3D kSpace with 2D subsampling along y and z to 3D, i.e. apply sparsifying transformation along all image dimensions (x-y-z) or to 2D, i.e. apply sparsifying transformation just along sparse dimensions (y-z).

The GUI allows to edit the parameter file (default_parameters.m). Please see the parameter file and Documentation for all possible options.

Afterwards the reconstruction is started via calling:

// data: - subsampled k-space: ISMRMD format
//                             or following structure:
//                             cell array: nSlices x nChannels x nRepetitions x nAverages
//                             each cell: 2D: nYPhase x nXFreq x (nTime) (single/double array)
//                                        3D: nYPhase x nXFreq x nZPhase (single/double array)
//                                        4D: nYPhase x nXFreq x nZPhase x nTime (single/double array)
//       - path to raw Siemens measurement file (*.dat)
// para: - path to parameter file (e.g. parameters.m)
//       - parameter struct
[imageSOS, imageCha] = CS_reconstruction(data, para);

The sum-of-squared channel combined image imageSOS and the channel-separate image imageCha are returned.

The GUI visualizes the imageSOS and allows to compare the obtained images against a non-accelerated or zero-padded image or an image derived from another algorithm.

Scrolling through different image slices (mouse wheel), scaling (pressed mouse wheel) and zooming are supported in the GUI.

Issues/bugs

Please use GitHub to report any problems: https://github.com/thomaskuestner/CS_LAB/issues

References

MR-based respiratory and cardiac motion correction for PET imaging.

Medical Image Analysis In: Medical Image Analysis. Elsevier, 2017.

Thomas Küstner, Martin Schwartz, Petros Martirosian, Sergios Gatidis, Ferdinand Seith, Christopher Gilliam, Thierry Blu, Hadi Fayad, Dimitris Visvikis, F. Schick, B. Yang, H. Schmidt and N.F Schwenzer.

[doi] [BibTeX] [Endnote]

Compressed Sensing LAB: An MR acquisition and reconstruction system.

In: Proceedings of the ISMRM Workshop on Data Sampling and Reconstruction. Sedona, AZ, USA, 2016.

Thomas Küstner, Martin Schwartz, Christian Würslin, Petros Martirosian, Nina F. Schwenzer, Bin Yang and Holger Schmidt.

[BibTeX] [Endnote]

Image Reconstruction System for Compressed Sensing Retrospective Motion Correction for the Application in Clinical Practice.

In: Proceedings of the International Society for Magnetic Resonance in Medicine (ISMRM). Singapore, 2016.

Martin Schwartz, Thomas Küstner, Christian Würslin, Petros Martirosian, Nina F. Schwenzer, Fritz Schick, Bin Yang and Holger Schmidt.

[BibTeX] [Endnote]