SEPIA Documentation

Welcome to the SEPIA documentation! Here you can find all the documents related to SEPIA.

SEPIA provides a graphical user interface in Matlab to build data processing pipelines related to quantitative susceptibility mapping (QSM).

SEPIA is designed to solve two issues I encountered during my research in QSM:

  1. Using algorithms from toolboxes developed by different research groups,
  2. Having a platform such that I can quickly adjust (and remember) parameters of each algorithm.

The purpose of SEPIA is to provide a platform for easy access to different QSM processing methods in the field. It provides interfaces to use the following three toolboxes freely available online for academic purposes, i.e.

  1. MEDI toolbox
  2. STI Suite
  3. FANSI toolbox

Through SEPIA I hope researchers who are not coming from the field could also be able to use QSM for their research. For those more experienced researchers, I also hope this tool can simplify your workflow.

Table of Contents

Installation

Prerequisite

To use SEPIA you need three QSM toolboxes which are freely available for the research community, namely MEDI toolbox, STI Suite and FANSI toolbox. You can download these toolboxes with the following links:

If you encounter any difficulty when downloading these toolboxes please let me know.

Installing SEPIA

Once you have all the toolboxes in place, then you have to specify the directory of each toolbox in SpecifyToolboxesDirectory.m:

MEDI_dir = '/path/to/MEDI/toolbox/';
STISuite_dir = '/path/to/STISuite/toolbox/';
FANSI_dir = '/path/to/FASI/toolbox/';

For example, I have all my external toolboxes stored under the SEPIA home directory. Additionally, for each toolbox, I have different copies representing different versions when they were published

_images/show_how_to_specify_path.png

and here is an example of how is my SpecifyToolboxesDirectory.m defined:

% 1. sepcify the toolbox version you want to run
MEDI_version        = 'MEDI_toolbox_20180625';
FANSI_version       = 'FANSI-toolbox-d33759b970790cc8754adc9d0398cc3d07546074/';
STISuite_version    = 'STISuite_V3.0';

% 2. get the Sepia HOME directory from this script
fullName        = mfilename('fullpath');
SEPIA_HOME      = fileparts(fullName);

% 3. specify the top level of external dependency directory
external_dir    = [SEPIA_HOME filesep 'external' filesep];

% 4. specify the HOME directory of each toolbox
MEDI_HOME       = [external_dir 'MEDI_toolbox' filesep];
FANSI_HOME      = [external_dir 'FANSI_toolbox' filesep];
STISuite_HOME   = [external_dir 'STI_Suite' filesep];

% 5. sepcify the final destination of each toolbox you want to run in Sepia
MEDI_dir        = [MEDI_HOME MEDI_version filesep];
FANSI_dir       = [FANSI_HOME FANSI_version filesep];
STISuite_dir    = [STISuite_HOME STISuite_version filesep];

IMPORTANT: Please do not modify the original structure of these toolboxes, SEPIA searches the path of the related functions based on the original folder structure.

Finally, you have to add the directory containing sepia.m, i.e. the SEPIA HOME directory, to your MATLAB PATH

This can be done by: ‘Set Path’ -> ‘Add Folder’ -> /your/sepia/directory/ -> ‘Save’

(Caution: To ensure only the selected algorithm is used for the QSM processing, please do not manually add the paths to the external toolboxes you want to run in SEPIA to the Matlab PATH, the sepia_addpath function will do the job for you:).)

or

with MATLAB’s command: addpath('/your/sepia/directory')

Now you can start the GUI by entering sepia in the MATLAB’s command window.

Compatibility

SEPIA is developed mainly in MATLAB R2016b in Linux. In general, all methods should compatible with earlier MATLAB versions. Most of the methods should also compatible with MATLAB R2017a or later, and other OS, except the following functions/algorithms

  • DICOM reader
  • Laplacian Boundary Value (LBV) for background field removal
  • Graphcut for phase unwrapping

Data Preparation

SEPIA supports the following type of data input:

  • uncompressed or compressed NIfTI images (.nii and .nii.gz)

DICOM images

DICOM images input has been deprecated since v.0.7.0.

NIfTI images

NIfTI data is a handy way to work with SEPIA. SEPIA is mainly designed for multi-echo GRE (mGRE) data. Therefore, the main standalone of SEPIA can only work with 4D (row, column, slice, time) NIfTI data (3D for some standalone applications).

Data conversion

So far there are three data conversion tools tested in SEPIA:

  1. One way to convert DICOM images into 4D NIfTI data is to use MRIConvert with the following setting checked: ‘Option’ -> ‘Save multivolumes series as 4D files’
_images/mriconvert_save4d.png

In this way, your mGRE data will be stored as 4D FSL NIfTI data that is a valid input of SEPIA.

  1. Alternatively, you can also use dcm2niix to convert your data. Please make sure the ‘merge’ option (-m) is set to ‘no’ for the conversion (i.e. dcm2niix -m n). In this way, multiple 3D volumes (the number of volumes depends on the number of echoes acquired) will be created together with the JSON files containing the TE of each echo (if you enable the merge option of dcm2niix you will only have one JSON file containing one TE). You can then merge the echo images into 4D using tools like fslmerge.
  2. File formats generated by dicm2nii are also supported in SEPIA.

Data input

Once you have the NIfTI files ready, SEPIA provides two options to load the data:

  • select the required files directly, or
  • prepare the data with specific names and put all of them in a common directory, from which you can specify the input directory in SEPIA. The name requirement depends on the standalone you are working on. For more specific details please check the wiki pages of each standalone applications.

SEPIA header

To obtain a frequency shifted map or magnetic susceptibility map with correct units, it is important to inform the corresponding algorithm(s) with information including the main magnetic field strength (B0) of the scanner, the main magnetic field direction with respect to the field of view (FOV) and the echo times (TEs) used in the acquisition. Unfortunately, such information may not be (directly) available in the NIfTI header after the DICOM conversion. As a result, if you are using NIfTI files with SEPIA, you have to also supply a special header file alongside with your multi-echo GRE data.

SEPIA requires a specific MAT-file (.mat) that stores some header information of the input data. The following example shows the variables (case-sensitive) that must be stored in the header file:

B0 = 3;                 % magnetic field strength, in Tesla
B0_dir = [0;0;1];       % main magnetic field direction, [x,y,z]
CF = 3*42.58*1e6;       % imaging frequency, in Hz (B0*gyromagnetic_ratio*1e6)
TE = [te1,te2,te3,te4]; % echo time for each GRE image, in second
delta_TE = te2-te1;     % echo spacing, in second
matrixSize = [64,64,64] % image matrix size
voxelSize = [1,1,1]     % spatial resolution of the data, in mm

You can create this file manually in Matlab. Alternatively, you can use the Utility standalone application to generate the file. Please visit the corresponding wiki page for more information about how to generate the header file.

SEPIA (One-stop QSM processing)

What is SEPIA?

SEPIA is a pipeline analysis tool for quantitative susceptibility mapping (QSM) in Brain Imaging. It provides all the essential functions people would need to compute a susceptibility map from a 3D multi-echo GRE phase data, including phase unwrapping, background field contribution removal and dipole inversion. Incorporate with different toolboxes in SEPIA giving users the advantages of having a variety of options to build a pipeline that works the best for their data. When you use the SEPIA graphical user interface to process the data, a log file will be generated that contains also the setting and command that you’ve chosen in the pipeline. This log file will be particularly useful for batch processing.

Structure of the application

This standalone consists of 4 panels:

  • Input/Output(I/O) panel,
  • Total field recovery and phase unwrapping panel,
  • Background field removal panel, and
  • QSM panel.

The detailed description of each panel is given below:

I/O panel

  • Data input

    This application accepts three types of data input method:

    1. Specify a directory that contains all NIfTI images. Please specify the names of your data as in the following:
      • Phase: must contain the string ‘ph’ in the filename, e.g. phase.nii.gz;
      • Magnitude: must contain the string ‘mag’ in the filename, e.g. magn.nii.gz;
      • Header: must contain the string ‘header’ in the filename, e.g. header.mat;
      • (optional) Mask data: if provided, must contain string ‘mask’ in the filename, e.g. mask.nii.gz, or
    2. Specify the required data separately using the GUI buttons.
  • Data output

    You can specify the prefix of the data output name in the editable field ‘Output basename’. By default, the SEPIA output will be stored in a directory named ‘output’ under the input directory, i.e. ‘_/your/input/directory/output/_’ with prefix ‘sepia’. You can change the default output directory and basename to whatever you need. If the output directory does not exist, the application will create the directory.

  • Brain mask

    QSM-related algorithms often require a mask that contains only brain tissue. If you already have the brain mask data in NIfTI format, you can select the file manually, or named it with a specific name (see Data input section) and put it in the directory with other NIfTI files. Alternatively, you can check the ‘FSL brain extraction’ checkbox to extract the brain mask. Enabling this option will run the Matlab implementation of FSL’s brain extraction tool (bet) implemented with MEDI toolbox.

  • Invert phase data

    Due to the way of how the phase data is stored, values of the final local field map and/or magnetic susceptibility map might be inverted, i.e. positive frequency shift and paramagnetic magnetic susceptibility will show in negative, and vice versa. If it is the case, you can invert the values of the results by checking the ‘Invert phase data’ option. This will apply a conjugate operation to the phase data after the data being loaded.

Total field recovery and phase unwrapping panel

  • Echo phase combination

    As the first step to process the multi-echo data, we need to recover the total frequency shift of the tissue across times. SEPIA provides two different ways to do this:

    1. Optimum weights

    This is a weighted combination of the phase difference between successive echoes, in which the weights are inversely proportional to the variance of the noise of the fieldmap estimated from the magnitude echo images.

    1. MEDI nonlinear fit

    This is a method in the MEDI toolbox

  • Phase unwrapping

    There are 5 phase unwrapping method supported in SEPIA

    1. Laplacian

    Laplacian unwrapping implementation in MEDI toolbox

    1. Laplacian STI suite

    Laplacian unwrapping implementation in STI Suite v3.0

    1. 3D best path

    Robust region growing method yet only works in the DCCN cluster (recommended if you use this toolbox in the DCCN cluster)

    1. Region growing

    Region growing method in the MEDI toolbox

    1. Graphcut

    Graph-cut algorithm in the MEDI toolbox, sometimes uses with water-fat imaging.

  • Bipolar readout eddy current correction:

    enable to correct the phase inconsistency between odd and even echoes, and a gradient-like field contribution by eddy current effect due to bipolar readout. If this option is enabled, the eddy current corrected data will be stored in the output directory with the following name:

    • phase_eddy-correct.nii.gz (eddy current corrected phase data)
  • Exclude unreliable voxels, Threshold:

    enable to exclude low SNR voxels that can create strong artefacts in susceptibility map (you may check with ‘relative-residual.nii.gz’ to adjust the threshold). Voxels that have relative fitting residual greater than the threshold will be weighted with zero in subsequent processes. Only available for region growing and 3D best path unwrapping methods.

  • Output

    The output of this step are given below:

    • total-field.nii.gz (unwrapped total (background+local) field, in Hz)
    • fieldmap-sd.nii.gz (normalised field map standard deviation)
    • mask.nii.gz (FSL’s bet brain mask, optional)
    • mask-reliable.nii.gz (thresholded brain mask, optional)
    • relative-residual.nii.gz (relative residual of fitting a mono-exponential decay function with a single frequnecy shift, depends on unwrapping method)

Background field removal panel

  • Method

    1. LBV

      Laplacian boundary value approach to removal background field

    2. PDF

      Projection onto dipole field

    3. RESHARP

      regularisation enabled SHARP

    4. SHARP

      Sophisticated harmonic artefact reduction for phase data

    5. VSHARP STI suite

      STI suite v3.0 variable-kernel SHARP

    6. VSHARP

    7. iHARPERELLA

      (not optimised with SEPIA yet)

  • Refine local field by 4th order 3D polynomial fit

    Enable to remove residual B1(+ & -) contribution in the local field

  • Output

    The output of this step are given below:

    • local-field.nii.gz (local (or tissue) field, in Hz)
    • mask-qsm.nii.gz (brain mask where local field is reliable, might be eroded and depended on the background field removal algorithms and ‘exclude unreliable voxels’ threshold value)

QSM panel

  • Method:

    1. TKD

      Thresholded k-space division

    2. Closed-form solution

      closed-form solution with L2-norm regularisation

    3. STI suite iLSQR

      STI suite v3.0 implementation of iterative LSQR approach

    4. iLSQR

    5. FANSI

      Fast algorithm for nonlinear susceptibility inversion

    6. Star

      STI suite v3.0 Star-QSM (recommended)

    7. MEDI

      Morphology enabled dipole inversion (MEDI+0)

  • Output

    The output of this step is given below:

    • QSM.nii.gz (quantitative susceptibility map, in ppm)

Phase Unwarpping Standalone

Why do we need phase unwrapping?

Phase wrapping occurs when continuous phase information is sampled in a discrete wrapped phase. The measured phase accumulation larger than one phase cycle is wrapped into the interval [-\pi, \pi), causing the discontinuity in the phase data. To recover the true phase values, one must solve this ambiguity problem by adding the correct integer number of phase cycles to the phase data in order to recover the true phase revolution.

The objective of this standalone application is to recover the actual, total phase shift of the acquired data.

Structure of the application

This standalone consists of two panels:

  • I/O panel, and
  • Total field recovery and phase unwrapping panel.

The detailed description of each panel is given below:

I/O panel

_images/phase-unwrapping_io.png
  • Data input

    This application accepts three types of data input method:

    1. Specify a directory that contains all DICOM images,
    2. Specify a directory that contains all NIfTI images. Please specify the names of your data as in the following: - Phase: must contain the string ‘ph’ in the filename, e.g. phase.nii.gz; - Magnitude: must contain the string ‘mag’ in the filename, e.g. magn.nii.gz; - Header: must contain the string ‘header’ in the filename, e.g. header.mat; - (optional) Mask data: if provided, must contain string ‘mask’ in the filename, e.g. mask.nii.gz, or
    3. Specify the required data separately using the GUI buttons.
  • Data output

    You can specify the prefix of the data output name in the editable field ‘Output basename’. By default, the SEPIA output will be stored in a directory named ‘output’ under the input directory, i.e. ‘_/your/input/directory/output/_’ with prefix ‘sepia’. You can change the default output directory and basename to whatever you need. If the output directory does not exist, the application will create the directory.

  • Brain mask

    QSM related algorithms often require a mask that contains only brain tissue. If you already have the brain mask data in NIfTI format, you can select the file manually, or named it with a specific name (see Data input section) and put it in the directory with other NIfTI files. Alternatively, you can check the ‘FSL brain extraction’ checkbox to extract the brain mask. Enabling this option will run the Matlab implementation of FSL’s brain extraction tool (bet) implemented with MEDI toolbox.

  • Invert phase data

    Due to the way of how the phase data is stored, values of the final local field map and/or magnetic susceptibility map might be inverted, i.e. positive frequency shift and paramagnetic magnetic susceptibility will show in negative, and vice versa. If it is the case, you can invert the values of the results by checking the ‘Invert phase data’ option. This will apply a conjugate operation to the phase data after the data being loaded.

Total field recovery and phase unwrapping panel

_images/phase-unwrapping_total-field.png
  • Echo phase combination

    As the first step to process the multi-echo data, we need to recover the total frequency shift of the tissue across times. SEPIA provides two different ways to do this:

    1. Optimum weights

    This is a weighted combination of the phase difference between successive echoes, in which the weights are inversely proportional to the variance of the noise of the fieldmap estimated from the magnitude echo images.

    1. MEDI nonlinear fit

    This is a method in the MEDI toolbox

  • Phase unwrapping

    There are 5 phase unwrapping method supported in SEPIA

    1. Laplacian

    Laplacian unwrapping implementation in MEDI toolbox

    1. Laplacian STI suite

    Laplacian unwrapping implementation in STI Suite v3.0

    1. 3D best path

    Robust region growing method yet only works in the DCCN cluster (recommended if you use this toolbox in the DCCN cluster)

    1. Region growing

    Region growing method in MEDI toolbox

    1. Graphcut

    Graph-cut algorithm in MEDI toolbox, usually uses in water-fat imaging.

  • Bipolar readout eddy current correction:

    enable to correct the phase inconsistency between odd and even echoes, and a gradient-like field contribution by eddy current effect due to bipolar readout. If this option is enabled, the eddy current corrected data will be stored in the output directory with the following name:

    • phase_eddy-correct.nii.gz (eddy current corrected phase data)
  • Exclude unreliable voxels, Threshold:

    enable to exclude low SNR voxels that can create strong artefacts in susceptibility map (you may check with ‘relative-residual.nii.gz’ to adjust the threshold). Voxels that have relative fitting residual greater than the threshold will be weighted with zero in subsequent processes. Only available for region growing and 3D best path unwrapping methods.

  • Output

    The output of the standalone application is given below:

    • total-field.nii.gz (unwrapped total (background+local) field, in Hz)
    • fieldmap-sd.nii.gz (normalised field map standard deviation)
    • mask.nii.gz (FSL’s bet brain mask, optional)
    • mask-reliable.nii.gz (thresholded brain mask, optional)
    • relative-residual.nii.gz (relative residual of fitting a mono-exponential decay function with a single frequnecy shift, optional)

Background Magnetic Field Removal Standalone

Why do we need to remove background field?

The phase we measured in a GRE acquisition is affected by not only the brain tissue but also sources like B0 inhomogeneity and air sinus. In order to compute the susceptibility sources only contributed by the brain tissue, it is important to remove all the non-local field effect. Fortunately, the characteristic of the local field is different from that of the non-local field, it is possible to separate the two fields from the unwrapped total field. This standalone application is designed to solve the field separation problem.

Caution: It is crucial that the background field contribution is removed accurately in this stage. Otherwise, the remaining field due to background sources will be treated as part of the local field, degrading the quality of QSM result.

Structure of the application

This application consists of two panels:

  • I/O panel, and
  • Background field removal panel.

The detailed description of each panel is given below:

I/O panel

_images/background-field-removal_io.png
  • Data input

    This application accepts two types of data input method:

    1. Specify a directory that contains all NIfTI images. Please specify the names of your data as in the following:
      • Total field data: must contain the string ‘total-field’ in the filename, e.g. total-field.nii.gz;
      • Header: must contain the string ‘header’ in the filename, e.g. header.mat;
      • (optional) Fieldmap standard deviation data: must contain the string ‘fieldmap-sd’ in the filename, e.g. fieldmap-sd.nii.gz;
      • (optional) Mask data: if provided, must contain string ‘mask’ in the filename, e.g. mask.nii.gz, or
    2. Specify the required data separately using the GUI buttons.
  • Data output

    You can specify the prefix of the data output name in the editable field ‘Output basename’. By default, the Sepia output will be stored in a directory named ‘output’ under the input directory, i.e. ‘/your/input/directory/output/’ with prefix ‘sepia’. You can change the default output directory and basename to whatever you need. If the output directory does not exist, the application will create the directory.

  • Brain mask

    QSM related algorithms often require a mask that contains only brain tissue. If you already have the brain mask data in NIfTI format, you can select the file manually, or named it with a specific name (see Data input section) and put it in the directory with other NIfTI files.

Background field removal panel

_images/background-field-removal_background-field.png
  • Method

    1. LBV

    Laplacian boundary value approach to removal background field

    1. PDF

    Projection onto dipole field

    1. RESHARP

    Regularisation enabled SHARP

    1. SHARP

    Sophisticated harmonic artefact reduction for phase data

    1. VSHARP STI suite

    STI suite v3.0 variable-kernel SHARP

    1. VSHARP
    2. iHARPERELLA

    (not optimised with SEPIA yet)

  • Refine local field by 4th order 3D polynomial fit

    Enable to remove residual B1(+ & -) contribution in the local field

  • Output

    The output of the standalone application is given below:

    • local-field.nii.gz (local (or tissue) field, in Hz)
    • mask-qsm.nii.gz (brain mask where local field is reliable, might be eroded and depended on the background field removal algorithms and ‘exclude unreliable voxels’ threshold value)

QSM Standalone

How can we map the magnetic susceptibility sources from local field map?

A local field (or tissue field) is the field generated by the magnetic susceptibility sources from the brain tissue. The assumption of the field generated by a magnetic susceptibility point source is a dipole field. We can then try to compute the susceptibility values by deconvolving the local field with a dipole field. However, due to the fact that the dipole field in the k-space (i.e. the dipole kernel) has zero values on the cone surface at 54.7° and values close to this surface will also be close to zeros. As a result, the number of unknown parameters is more than the measurements we have in the data, leading to the problem ill-conditioned and the resulting QSM map has the so-called streaking artefact. To solve the ill-conditioned problem, most of the QSM algorithms try to add a regularisation term in the QMS dipole inversion problem, imposing spatial smoothness in the QSM map and/or the QSM map has similar anatomical features as shown in the magnitude images in order to reduce the streaking artefact in the QSM result.

Structure of the application

This standalone consists of two panels:

  • I/O panel, and
  • QSM panel.

The detailed description of each panel is given below:

I/O panel

_images/qsm_io.png
  • Data input

    This application accepts two types of data input method:

    1. Specify a directory that contains all NIfTI images. Please specify the names of your data as in the following:
      • Local field data: must contain the string ‘local-field’ in the filename, e.g. local-field.nii.gz;
      • Header: must contain the string ‘header’ in the filename, e.g. header.mat;
      • Magnitude data: must contain the string ‘magn’ in the filename, e.g. magn.nii.gz;
      • (optional) Fieldmap standard deviation data: must contain the string ‘fieldmap-sd’ in the filename, e.g. fieldmap-sd.nii.gz;
      • (optional) Mask data: if provided, must contain string ‘mask’ in the filename, e.g. mask.nii.gz, or
    2. Specify the required data separately using the GUI buttons.
  • Data output

    You can specify the prefix of the data output name in the editable field ‘Output basename’. By default, the Sepia output will be stored in a directory named ‘output’ under the input directory, i.e. ‘/your/input/directory/output/’ with prefix ‘squirrel’. You can change the default output directory and basename to whatever you need. If the output directory does not exist, the application will create the directory.

QSM panel

_images/qsm_qsm.png
  • Method:

    1. TKD

    Thresholded k-space division

    1. Closed-form solution

    closed-form solution with L2-norm regularisation

    1. STI suite iLSQR

    STI suite v3.0 implementation of iterative LSQR approach

    1. iLSQR
    2. FANSI

    Fast algorithm for nonlinear susceptibility inversion

    1. Star

    STI suite v3.0 Star-QSM

    1. MEDI

    Morphology enabled dipole inversion (MEDI+0)

  • Output

    The output of the standalone application is given below:

    • QSM.nii.gz (quantitative susceptibility map, in ppm)

Choosing a right phase unwrapping method for your data

SEPIA provides a range of phase unwrapping methods from the supported toolboxes. In this demonstration, I will try to show the differences between two main phase unwrapping methods: (1) region growing and (2) Laplacian-based - an important processing step to reveal the (true) phase of MRI gradient echo data for QSM processing.

Data preparation

The in vivo test data was downloaded from Cornell MRI lab and converted to NIfTI format by dicm2nii. FSL’s BET was used to extract the brain mask to improve the processing result.

Processing

Test 1: Unwrapping the phase with a small amount of wrapping effect

To begin with, let have a look of the phase image from the 1st echo GRE data (TE=3.6ms)

_images/wrap-phase_e-1.png

Under a linear model assumption the phase of each voxel over time can be expressed by the following equation:

phase = angular frequency \times time [1]

However, this phase value is constrained in the interval of [-pi,pi) in the MRI phase data. Any value that is outside of this interval will be wrapped back to this interval (see red arrows). For QSM processing, it is important to unwrap the phase such that the true frequency shift inside the voxel can be computed using the above equation.

To unwrap the phase images, there are two main methods being used: (1) region growing and (2) Laplacian operator. In SEPIA, you can use the following commands to access the methods:

% region growing
unwrappedPhase = UnwrapPhaseMacro(wrappedPhase,matrixSize,voxelSize,'method','rg','magn',magn,'mask',mask);
% Laplacian
unwrappedPhase = UnwrapPhaseMacro(wrappedPhase,matrixSize,voxelSize,'method','laplacian');
unwrappedPhase = UnwrapPhaseMacro(wrappedPhase,matrixSize,voxelSize,'method','laplacian_stisuite');
Region growing
_images/unwrap-phase_rg_e-1.png
Laplacian
_images/unwrap-phase_laplacian_e-1.png

Both methods can unwrap the 1st echo phase successfully, but they show different brightness under the same dynamic range (-2pi,2pi). Where does this difference come from?

Let’s compare the unwrapped phase with the original wrapped phase. In Matlab this can be done by: phase_residual = angle(exp(1i*wrappedPhase) .* conj(exp(1i*unwrappedPhase)));

Here are the residual phase maps form

Region growing
_images/phase-diff_rg_e-1.png

The residual map shows 0s everywhere. This means that the unwrapped phase image is just a summation of 2xpixN (N is an integer) of the original wrapped phase map (which is unwrapped in this case).

Laplacian
_images/phase-diff_laplacian_e-1.png

This shows that the unwrapped phase from the Laplacian method is not an exact summation of 2xpixN to the original phase. It is due to the fact that the Laplacian operator removes some of the harmonic field components from the original phase image (which is the slowly-varying field in this image). Since the harmonic field will also be removed from later on processing steps in QSM processing, Laplacian unwrapping is still a good method to unwrap the signal phase in this case (we didn’t see any brain structure in the residual map except veins).

Test 2: Unwrapping the phase with a large amount of wrapping effect

From Eq.1, we can see that phase accumulated with an increase of time. Therefore when we look at the later echo(es), we can see more phase wrapping appeared and here is an example at the 8th echo (TE=45ms) of the testing data

_images/wrap-phase_e-8.png

We can use the same unwrapping methods as we did before and look at the results again:

Region growing
_images/unwrap-phase_rg_e-8.png

The region growing method can still produce a reliable result in most of the brain regions even in the presence of a large wrapping effect. Yet, unwrapping errors can be observed in the posterior blood vessel and in the temporal lobe (see arrows). It is apparently caused by the relatively large susceptibility field together with the low SNR in these regions.

Laplacian
_images/unwrap-phase_laplacian_e-8.png

The unwrapped phase is smooth from the Laplacian method but is it truly better than that of the region growing method? Let’s compare the unwrapped phase with the original phase to see more detail!

Here are the residual phase maps form

Region growing
_images/phase-diff_rg_e-8.png

Once again, the residual map shows 0s everywhere, suggesting that the unwrapped phase is a summation of 2xpixN of the original phase even though it didn’t unwrap the phase correctly in some regions.

Laplacian
_images/phase-diff_laplacian_e-8.png

More harmonic components were removed compared to the case of 1st echo. In addition, we can start seeing brain structures (arrows indicating the red nuclei) in the residual phase which is not optimal for QSM. Nonetheless, the incorrect unwrapped phase generated by region growing method can actually create more problems in later QSM processing.

Summary

Region growing method should be used in the first attempt to unwrap the raw phase image. It is reliable for a small amount of wrapped effect and represents the true phase value (for successful unwrapping). Laplacian method is very robust to unwrap a large amount of phase wrapping by trading a small degree of accuracy in the unwrapping results.

(f)MRI Toolkit 2019

Objectives

  • Understanding the background of magnetic susceptibility contrast
  • Gaining experience in basic QSM processing

Target Audience

  • who is new to SEPIA
  • who wants to know some basic knowledge about QSM

Estimated Time

About 1 hour

Introduction

In this tutorial, we will go through the standard processing pipeline for quantitative susceptibility mapping (QSM), a novel contrast mechanism that can provide local tissue magnetic properties.

Theory: QSM physics

Briefly, there are two main types of magnetic property (a.k.a magnetic susceptibility, \chi) we can measure with MR:

  • Paramagnetism: substances with paramagnetic property generate a secondary magnetic field that enhances the existing magnetic field generated by the MRI scanner. A typical example is iron either in blood or stored in ferritin;
  • Diamagnetism: substances with diamagnetic property generate a secondary magnetic field that reduces the existing magnetic field strength. Examples included myelin and calcification.
_images/qsm_ref.png

Figure 1: A QSM map. Deep grey matter structures such as globus pallidus and putamen containing high iron concentration is bright (positive magnetic susceptibility) while white matter, which is myelin-rich tissue, is dark (negative magnetic susceptibility). Studies have shown that the susceptibility values in the deep grey matter are highly correlated with iron staining histology result.

Because of the secondary magnetic field generated by (both paramagnetic and diamagnetic) tissues, the overall magnetic field experienced by the water protons will no longer be the same across the whole brain. The strength of this magnetic field inhomogeneity will depend on the local magnetic susceptibility sources: sources with stronger magnetic susceptibility can create a stronger inhomogeneity effect. As a result, the water protons will resonate in different frequencies across the whole brain and the frequency difference at each location is depended on the strength of the neighbouring sources. Measuring the frequency shift can, therefore, compute the magnetic susceptibility of brain tissues and reveal their cellular environment.

Note

Water protons are the main sources of MRI signal. In QSM, they act as our little magnetic field detectors to reveal the local changes of the magnetic field due to their surrounding environment.

Back to (f)MRI Toolkit 2019.

_images/qsm_model_flow.png

Figure 1: The QSM theory. A magnetic source generates a secondary magnetic field inside the MRI scanner, which will eventually alter the signal phase we measured. Decoding the phase images allows us to detect the molecular environment of the brain tissues.

Exercises

Let’s begin with the following exercises that will take you from the phase data to the susceptibility maps!

Exercise 1

Objectives
  • Understanding the data required for QSM
  • Understanding why we need to correct the phase data before mapping the magnetic susceptibility
Data Required
  • a 4D raw phase data (phase.nii.gz in the input directory)
  • a 4D raw magnitude data (mag.nii.gz in the input directory)
  • JSON files generated by data conversion software (all .json in the input directory)
Estimated time

About 15 min.

Understanding multi-echo GRE data

To compute a magnetic susceptibility map, multi-echo gradient-echo images are usually used because it can provide phase images.

Theory: MR Phase

As mentioned in the introduction, water protons resonate at different frequencies because of the tissue magnetic susceptibility. The frequency difference in brain tissues can be detected as the difference in phase accumulation over time (phase = frequency \times time). Therefore, the phase measurement of the MRI signal allows us to map the effect of the magnetic susceptibility of brain tissues.

It should be noted that the phase can only be measured in the range of [-180, 180] degrees (or [-\pi, \pi] radian).

Back to Exercise 1.

Go to the exercise directory which is located in ~/qsm_tutorial/.

You can use the following command in the terminal:

cd ~/qsm_tutorial/

Note

Here we assume your tutorial directory is in the home directory ‘~/’. If not, replace ‘~/’ with the path containing the folder ‘qsm_tutorial’.

To view the content of the directory use the command: ls

_images/exercise_directory.png

You will see there are two folders in the directory.

  • sepia - contains the software we will use throughout this tutorial;
  • data - contains the multi-echo gradient echo images we will work on.

Go to the data directory using cd data and have a look of the content inside the folder ls

_images/ls.png

You should see two NIfTI images (.nii.gz) and a few JSON files (.json) in the directory:

  • The NIfTI files mag.nii.gz and phase.nii.gz contain the magnitude and the phase data acquired with a multi-echo gradient echo sequence.

    Both images are 4D datasets, with the first 3 dimensions containing spatial information (i.e. the image of the brain) and echo time in the 4th dimension.

  • The JSON files contain important information such as the echo times (TE) and magnetic field strength (in Tesla), and orientation of the acquisition regarding the physical coordinates of the scanner. These are important to compute the magnetic susceptibility with the correct units and ensure the physical model is correct.

Magnitude images
  1. Take a look at the magnitude images. You can do this by calling the image viewer FSLView in the terminal:

    fslview_deprecated mag.nii.gz &

    Tip

    The ‘&’ character will enable the viewer running in the background so you can still work with the current section in the terminal.

    Note

    Due to the file size, it is better to view the images with FSLView instead of FSLeyes.

  2. Adjust the display window to ‘Min 0’ and ‘Max 300’.

  3. Click the movie button to see how the brain contrast changes with respect to the echo time (time between echoes = 4ms).

    _images/mag_display.png
  4. Click the movie button again to stop the movie. Press Ctrl+T to see the plot of signal evolution at different brain tissues over time.

  5. Select a few data points in the brain (e.g. caudate nucleus [98 169 87], white matter [143 106 92], and cortical grey matter [159 190 77]), how do you describe the signal change with respect to the echo time in general?

    Check Your Progress 1 _images/mag_decay.png

    You should be able to observe the signals decaying over time. Precisely, this is the so-called T2* signal decay of MR signal which results from water protons losing phase coherence over time. The mechanism of T2* decay is complicated because it is due to factors such as field inhomogeneity/diffusion/imperfect shimming, etc. Although QSM mainly works with phase images, magnitude images can be very useful because they share similar (but not always the same!) contrasts, therefore, have the potential to improve the quality of QSM maps.

    Back to Exercise 1.

  6. Go back to the terminal. Compute the mean magnitude image in time:

    fslmaths mag.nii.gz -Tmean mean_head.nii.gz

    This image will be used in Exercise 3.

Phase images
  1. Look at the phase images:

    fslview_deprecated phase.nii.gz &

    The phase images look different compared to the magnitude images and with the current display window it is hard to see any contrast in brain tissues.

  2. Adjust the display window to ‘Min. -3.14’ and ‘Max. -1’ and go through different slices. You should be able to identify some brain structures (e.g. at slice 82).

    _images/phase_display.png
  3. Change the window back to ‘Min. -3.14’ and ‘Max. 3.14’.

Based on Eq. (1), it is expected the phase increases/decreases monotonically. In other words, we should observe the phase contrasts become higher in the later echoes (i.e. bright brighter; dark darker).

(1)phase = frequency \times time

  1. Click the movie button to see the phase development over time. Can you make this observation?

    Check Your Progress 2 _images/phase_evol.gif

    In some regions the phase contrast is changing linearly with time (blue arrows, the white matter tract and gyrus are more pronounced in later echoes), but not in regions close to the prefrontal cortex and temporal lobes. In those regions, more and more replications of the zebra-line pattern (which represents phase jumps) appeared in the later echoes.

    Back to Exercise 1.

  2. Stop the movie and press Ctrl+T to see the phase accumulation at those problematic regions (e.g. near the prefrontal cortex [113 195 65]). Can you identify the cause of the problem?

    A. Somebody screwed up the acquisition

    Unfortunately, all phase images of mGRE data have a similar problem. So it is unlikely that everyone screwed their acquisition up.

    Back to Exercise 1.

    B. The subject moved during the scan

    Subject motion does induce changes in the phase images but certainly not responsible for the phase changes across echoes (each echo is separated by 4ms only!). Therefore, it is not the reason we have this observation.

    Back to Exercise 1.

    C. The phase is bounded to certain values

    Yes, this is the correct answer! There is nothing wrong about the signal phase generated by the tissues. However, when we sampled the signal, the phase values are constrained to the range -\pi \leq phase < \pi. When the true phase is outside of this range, a \pi will be added or subtracted to the true phase such that the apparent phase we observed from the data will still be inside the range.

    _images/phase_wrap.png

    Figure 1: An illustration of phase wrapping. The actual phase developed outside the range -\pi \leq phase < \pi over time but our measurement will only show the apparent phase.

    Note

    Think of an analogue clock with one hand only representing the hour. Every 12 hours the hand starts a new cycle again. If you look at the clock 13 hours after the first watch, it apparently advanced 1 hour only but the actual time difference between the two observations is 13 hours.

    Back to Exercise 1.

    D. Fast switching gradient introduced extra phase

    The instability of the fast switching gradient could induce extra phase offsets to the data. However, it is not the reason we have this observation in the phase images.

    Back to Exercise 1.

    E. I don’t know. I’m here to learn some fMRI analysis so just show me the answer

    There is nothing wrong about the signal phase generated by the tissues. However, when we sampled the signal, the phase values are constrained to the range -\pi \leq phase < \pi. When the true phase is outside of this range, a \pi will be added or subtracted to the true phase such that the apparent phase we observed from the data will still be inside the range.

    _images/phase_wrap.png

    Figure 1: An illustration of phase wrapping. The actual phase developed outside the range -\pi \leq phase < \pi over time but our measurement will only show the apparent phase.

    Note

    Think of an analogue clock with one hand only representing the hour. Every 12 hours the hand starts a new cycle again. If you look at the clock 13 hours after the first watch, it apparently advanced 1 hour only but the actual time difference between the two observations is 13 hours.

    Back to Exercise 1.

In order to estimate the frequency shift correctly using Eq. (1), this phase problem has to be addressed which is called phase unwrapping.

To unwrap the phase and to map back to the correct values, SEPIA provides several algorithms to do the job, and this is what we are going to do in the next exercise.

You can close all the FSLView window(s) now.

Proceed to Exercise 2.

Exercise 2

Objectives
  • Gaining experience in using SEPIA
  • Understanding how to perform phase unwrapping
Data Required
  • a 4D raw phase data (phase.nii.gz in the input directory)
  • a 4D raw magnitude data (mag.nii.gz in the input directory)
  • JSON files generated by data conversion software (all .json in the input directory)
Estimated time

About 20 min.

SEPIA

SEPIA is a pipeline tool to process phase images in Matlab. To use SEPIA, please open a Matlab application in the cluster by typing:

matlab2016b,

click OK, leave the runtime as default and specify the memory requirement as 10 (GB).

_images/matlab_job.png

Once Matlab is open, go to the tutorial directory and add the SEPIA home directory to the Matlab Path:

addpath('~/qsm_tutorial/sepia/');

Note

The copy of SEPIA you have in the tutorial directory already includes all the external toolboxes required. If you want to know how to set up SEPIA from scratch for your research purposes, you can refer to Installation.

Now, go the data directory in the Matlab command window and start sepia:

cd ~/qsm_tutorial/data

sepia

A graphical user interface (GUI) should be pop up.

_images/sepia_layout.png

The first tab in SEPIA provides a one-step application to process QSM from the raw phase data to a magnetic susceptibility map.

Alternatively, we can break down the processing pipeline into several steps and SEPIA also supports this approach.

Create a SEPIA header

Before using the SEPIA, create a header file that contains all essential information regarding the data acquisition (magnetic field, resolution, echo time).

Select the Utility tab and then select Get header info in the drop-down menu. This function provides several ways to extract the header information from different files.

With all the NifTI images and JSON files stored in the same place, we can use ‘Op 2’ routine:

  1. Click Open next to ‘Op 2’

    _images/get_header_open.png
  2. Select ~/qsm_tutorial/data as the input (The dialog box will show the current directory in Matlab).

    _images/get_header_dialog.png
  3. Click Save header to save the file.

    The process is done when you see the message ‘SEPIA header is saved!’ in the command window. You should see a new file is generated in the input directory.

Your setting should be like:

_images/get_header_overview.png
Phase Unwrapping and Total Field Computation

To correct the wrapped phase in the raw images, go the Phase unwrapping tab (next to Sepia tab).

You will see two panels under the tab: the I/O panel is for specifying data input and output and the Total field recovery and phase unwrapping panel is for selecting phase unwrapping and true phase estimation algorithms.

Tip

SEPIA supports two types of data input. If your data follows the SEPIA naming structure, you can select the directory containing all the input data as your input in the first row of I/O panel. Alternatively, you can specify the input files separately by following the instruction of the second row of the I/O panel.

In the I/O panel:

  1. Select the Input directory: ~/qsm_tutorial/data

  2. Change the Output basename to: ~/qsm_tutorial/data/output_unwrap/Sepia

  3. Check the FSL brain extraction

    It is essential to have a brain mask to produce a high-quality QSM map.

    _images/phase_unwrap_io.png

In the Total field recovery and phase unwrapping panel:

  1. Keep the Echo phase combination method as ‘Optimum weights’

  2. Change the Phase unwrapping method to ‘Laplacian STI suite’.

    _images/phase_unwrap_algorithm.png

Then click the Start button.

You should now see some messages displayed in the Matlab’s command window. These messages give you the general information of your input data and the overview of the selected method(s). Once the process finishes (~3min), you will see the message

Processing pipeline is completed!’.

Tip

All the output messages of SEPIA will be displayed on the Matlab command window. Make sure you check the command window before clicking the Start button again!

Check the output (should be in ~/qsm_tutorial/data/output_unwrap/), in the terminal type:

fslview_deprecated Sepia_unwrapped-phase.nii.gz

fslview_deprecated Sepia_total-field.nii.gz

The first dataset is the unwrapped phase images (unit in radian). Play the movie to see the phase development. All the zebra-line pattern and phase jumps are gone in the later echo images (e.g. near the prefrontal cortex [113 195 65]).

Note

Besides the ability of phase unwrapping, Laplacian based operation removes some harmonic fields. Therefore, the phase values in the unwrapped phase map cannot be comparable to the raw wrapped phase.

The second dataset corresponds to the frequency (Hz) map which was computed using the unwrapped phase images at the different echo times illustrated in Eq. (1):

(1)frequency = \frac{phase}{time}

The latter is the result needed in the next exercise.

You can close all the FSLView window(s) now.

Proceed to Exercise 3.

Back to Exercise 1.

Exercise 3

Objectives
  • Understanding why we need to remove the background magnetic field contributions before QSM
  • Fine-tuning method parameters to improve the background field removal results
Data Required
  • a 3D total field image (Sepia_total-field.nii.gz in the previous exercise output directory)
  • a 3D brain mask (Sepia_mask.nii.gz in the previous exercise output directory)
  • a SEPIA header (Sepia_header.mat in the input directory)
Estimated time

About 10 min.

Background Field Removal

The frequency map we obtained from the last exercise contains magnetic fields generated by not only the brain tissue but also the scanner hardware imperfection and fields generated at air/tissue interfaces. Therefore, we have to remove the non-tissue field, or background field, contributions before computing the susceptibility map.

One more step before computing QSM but why?

In the first exercise, display window had to be adjusted to visualize some brain structures. Why are these tissue contrasts ‘hidden’ in our images?

The data contains not only the phase generated by the brain tissues but also by the scanner hardware imperfection and fields generated at air/tissue interfaces such as sinuses and ear canals.

These non-tissue fields, or so-called background fields, can be one or two order(s) of magnitude stronger than the tissue fields and affects the global brain tissues.

Since we are only interested in the magnetic fields generated by the brain tissues, we have to remove these background fields before computing the QSM map. However, the background fields and tissue fields co-exist across the whole brain.

Luckily, the background fields have different mathematical properties and researchers have successfully developed various algorithms to separate the tissue fields from the background fields.

Back to Exercise 3.

_images/total_field_explain.png

Figure 1: The total field we obtained from the last exercise is the summation of tissue and background magnetic fields. In order to compute the magnetic susceptibility of the brain tissue correctly, the background field contributions have to be removed before mapping the tissue susceptibilities.

SEPIA provides 7 methods to remove the background magnetic fields. Today we will use the Laplacian boundary values (LBV) algorithm, which is, in general, quite robust.

Exercise 3.1

Go to the Background field removal tab. You will see two panels as in the Phase unwrapping tab.

In the I/O panel, specify the required files by using the open buttons in the second row:

  1. Total field: Sepia_total-field.nii.gz (from the output directory of the previous exercise),
  2. Header: Sepia_header.mat (from the input directory),
  3. Change the Output basename to: ~/qsm_tutorial/data/output_localfield/Sepia_peel-4
  4. Brain mask Sepia_mask.nii.gz (from the output directory of the previous exercise, which will tell the software what is not part of the background.)
_images/bfr_tab_io.png

Second, in the Background field removal panel, the ‘LBV’ method is shown by default. You can have three parameters to adjust.

  • ‘Tolerance’: a threshold to stop the algorithm.
  • ‘Depth’: multigrid level.
  • ‘Peel’: the layer of boundary voxels to be removed after computing the tissue (or so-called local) fields.
  1. Set Peel to: 4

    _images/bfr_tab_algorithm.png
  2. Press the Start button.

    Again, when the process is finished, you will see the message: ‘Processing pipeline is completed!’.

  3. Use FSLView to display the local field map (Hz) (should be in ~/qsm_tutorial/data/output_localfield/).

    fslview_deprecated Sepia_peel-4_local-field.nii.gz &

    Adjust the display window to ‘Min -5’ and ‘Max 5’.

Note you can clearly see the contrast between grey and white matter, and veins and tissue now. Other structures as the globus pallidus, red nuclei and substantia nigra are visible… but not quite normal.

  1. Compare the location of the edges of brain structures with what you can see in the mean magnitude image computed in Exercise 1.
  1. Use shortcut Crtl+A in the FSLView to add mean_head.nii.gz to the displayed local field maps.

  2. Adjust the display window of mean_head.nii.gz to ‘Min 0’ and ‘Max 300’.

  3. Go to location [133 155 81] which is on the top edge of the globus pallidus.

  4. Check/Uncheck the ‘Visibility’ button to turn on/off of the mean magnitude image.

    _images/visibility_button.png
  5. It is known that there is a high concentration of iron deposition in the globus pallidus. There it generated a strong secondary magnetic field. Can you identify the magnetic field generated by this structure?

You can close all the FSLView window(s) now.

Proceed to Exercise 4.

Advanced Exercise 3.2

Note

If you still have enough time, follow the exercise below.

In this exercise, we will focus on the differences of using different ‘Peel’ values.

  1. Change the Output basename to: ~/qsm_tutorial/data/output_localfield/Sepia_peel-2
  2. Set Peel to: 2
  3. Press the Start button. Again, when the process is finished, you will see the message: ‘Processing pipeline is completed!’.
  4. Use FSLView to display the local field map (Hz) when using ‘Peel’ value of 2 (should be in ~/qsm_tutorial/data/output_localfield/):

fslview_deprecated Sepia_peel-2_local-field.nii.gz &

Load the Sepia_peel-4_local-field.nii.gz map in the same window. You can do this by selecting ‘File Add…’ (or shorcut Crtl+A) and select Sepia_peel-4_local-field.nii.gz in the window provided.

_images/add_new_file.png
  1. Adjust the display window to ‘Min -5’ and ‘Max 5’ for both images.
  2. Set location as [119 142 88]. Look at the differences between the two maps globally.
  3. Check/Uncheck the ‘Visibility’ button in the bottom of the viewer to turn on/off of the top image. What are the main differences between the two results?

Proceed to Exercise 4.

Back to Exercise 2.

Exercise 4

Objectives
  • Understanding QSM dipole inversion
  • Gaining experience to use QSM algorithms
Data Required
  • a 3D local field image (Sepia_peel-4_local-field.nii.gz in the previous exercise output directory)
  • a 3D refined brain mask (Sepia_peel-4_mask-qsm.nii.gz in the previous exercise output directory)
  • a SEPIA header (Sepia_header.mat in the input directory)
Estimated time

About 15 min.

The Last Step

The last step of QSM processing is to deconvolute the local (tissue) field by the unit dipole field, such that the tissue magnetic susceptibility can be revealed. This can be described by:

(1)\chi = F^{-1}[\frac{F(Tissue field)}{F(d)}]

where F and F^{-1} are the Fourier and inverse Fourier transform operators.

This is the so-called dipole inversion of QSM, which is just the element-wise division between the Fourier transforms of the two images.

Theory: Dipole Inversion

When looking at the local-field you can see some beautiful contrasts between brain tissues. These local fields represent all the secondary magnetic field induced by the tissues (which are our magnetic susceptibility sources). The tissue is suddenly behaving like a small magnet and the effect of the magnetic field extends beyond the source itself.

Note

Think of a magnet that can attract a metal towards it even when the two objects are not intact. It is because the magnetic field generated by the magnet extends outside the magnet body itself.

The local fields generated by the magnetic susceptibility sources (\chi), can be computed using the following equation:

(1)Tissue field = \chi * d

where d is a unit (dipole) field that the source generated and has the following shape:

_images/dipole_example.png

Figure 1: An illustration of a unit dipole field in (i) sagittal section and (ii) surface rendered contour. Red colour represents a positive magnetic field and blue colour represents a negative magnetic field. (Reproduced from Wang & Liu MRM 2014, Wiley)

Eq. (1) basically means that the secondary magnetic field experienced by the tissue at each location is the summation of the fields generated by all other (surrounding) sources. Since we have the prior knowledge about the shape of the magnetic field generated by a unit source (which is d , the unit dipole field) and the field generated by the tissues (output of exercise 3, local-field.nii.gz), mapping the magnetic susceptibility of the tissue is just the deconvolution of these two spatial maps (a.k.a. dipole inversion).

Back to Exercise 4.

Sounds simple, isn’t it? Let’s try it out!

QSM: Dipole inversion

Move to the QSM tab of SEPIA.

Exercise 4.1

I/O panel:

  1. Select the Local field input: Sepia_peel-4_local-field.nii.gz (from the previous exercise output directory),

  2. Select the Header: Sepia_header.mat,

  3. Change the Output basename of the output to: ~/qsm_tutorial/data/output_qsm/Sepia_tkd-0,

  4. Select the Brain mask: Sepia_peel-4_mask-qsm.nii.gz (from the previous exercise output directory).

    Note

    An updated brain mask has to be used here because some edges were excluded from the original brain mask in the last operation.

    _images/qsm_tab_io.png

QSM panel:

  1. To do exactly the operation as in Eq. (1), set the threshold of the TKD algorithm to ‘0’ and press Start.

    _images/qsm_tab_algorithm.png
  2. Check the result Sepia_tkd-0_QSM.nii.gz in the output directory. Set the display window to ‘Min. -0.2’ and ‘Max. 0.2’ (ppm). Does it look like the QSM map as we expected?

Answer: Exercise 4.1

The result should look like the image below. We followed exactly the operation described in the dipole inversion equation, but what’s wrong?

_images/qsm_tkd-0.png

To understand the problem, let’s have a look at the denominator of the dipole inversion equation, which is the Fourier transform of the dipole field (so-called dipole kernel).

\chi = F^{-1}[\frac{F(Tissue field)}{F(d)}]

Dipole kernel, D = F(d)

Here is the image representation of the magnitude of the dipole kernel |D|

_images/dipole_kernel.png

Figure 1: The magnitude of the Fourier transform of the dipole field.

The dashed lines outlines the regions where the values in the dipole kernel are equal or very close to zero (which can be represented as a cone surface). This leads to the ill-defined division of zero problem! After dividing the two images, these regions will contain either undefined value (when values in dipole kernel equal to zeros) or unrealistic numbers (when values close to zeros), making the QSM map unusable:

_images/qsm_fourier_tkd-0.png

Figure 2: Fourier transform of the QSM map (i.e. in k-space). It is clear that the values on/near the cone surface in k-space are amplified.

Back to Exercise 4.

Exercise 4.2

To avoid the previous QSM map we can increase the threshold of the TKD.

  1. Change the Output basename to: ~/qsm_tutorial/data/output_qsm/Sepia_tkd-0p15.
  2. Change the threshold of the TKD algorithm to 0.15 and press Start.
  3. Check the result Sepia_tkd-0p15_QSM.nii.gz in the output directory. Display it along with the Sepia_tkd-0_QSM.nii.gz in FSLView. Do you see any improvement?
  4. Compare the location on the tissue edges (e.g. [133 155 81]) in this QSM map with what you can see in the mean magnitude image mean_head.nii.gz. Do the edges match between the two data now?
Answer: Exercise 4.2

You should now see some brain structures in the QSM map.

_images/qsm_tkd-0p15.png

The idea of the TKD method is very straightforward. Since we know the location in which the division results are unreliable (i.e. when D equal/close to zero), we can discard the information in these regions by replacing their values to zero after the element-wise division.

For example, without thresholding the QSM k-space:

_images/qsm_fourier_tkd-0.png

and we can threshold the above k-space when the magnitude of D is smaller than, e.g. 0.15, leading to

_images/qsm_fourier_tkd-0p15.png

The Fourier transform of the above image is the QSM map we obtained in this exercise.

Tip

However, the larger is the threshold value, the more is the information being discarded. Therefore, increasing the threshold can improve the appearance of the resulting QSM map (as artefacts reduced), we are also losing the accuracy between our input (i.e. local field map) and output (i.e. QSM map).

Back to Exercise 4.

Congratulations! You have finished all the exercises in this tutorial. If you still have time left, finish the advanced exercises or experiment with different QSM methods/methods’ parameters.

Advanced Exercise 4.3

To further improve the quality of the QSM map, some methods, such as Star-QSM, incorporate additional information, e.g. smoothness of the QSM map, during the QSM dipole inversion.

  1. Change the Output basename to: ~/qsm_tutorial/data/output_qsm/Sepia_star-qsm.
  2. Change the QSM method to ‘Star-QSM’ and press Start. It will take about 2 mins to finish.

It is difficult to see the differences between the two QSM maps with the naked eyes. Subtract the two maps so that you can see the differences:

fslmaths Sepia_tkd-0p15_QSM.nii.gz -sub Sepia_star-qsm_QSM.nii.gz difference_qsm

  1. Display the difference_qsm.nii.gz image (dispay window [-0.1,0.1]) in FSLView with Sepia_star-qsm_QSM.nii.gz (dispay window [-0.2,0.2]) and Sepia_tkd-0p15_QSM.nii.gz (dispay window [-0.2,0.2]) in the output directory. Can you see any difference between the two QSM maps?
Answer: Exercise 4.3

You should be able to see the QSM map produced by Star-QSM is less noisy compared to the TKD result.

When looking to the difference map (see below), you can see that the main difference is the so-called more pronounced streaking artefact present in the TKD QSM map (which can be identified in the sagittal and coronal views).

_images/difference_qsm.png

Back to Exercise 4.

Back to Exercise 3.

Acknowledgments

The methods and algorithms provided with SEPIA are contributed by:

MEDI Toolbox developed by

Weill Cornell MRI lab

  • DICOM reader
  • Matlab interface of using FSL’s brain extraction
  • Combination of echo phase using non-linear fitting
  • Laplacian phase unwrapping
  • Region growing phase unwrapping
  • Graphcut phase unwrapping
  • Laplacian boundary value (LBV) background field removal
  • Projection onto dipole field (PDF) background field removal
  • Morphology enabled dipole inversion QSM
  • Lateral ventricle masking

STI Suite developed by

Hongjiang Wei, PhD - University of California Berkeley, CA, USA

Wei Li, PhD, - University Texas Health Science Center at San Antonio Research Imaging Institute, San Antonio, TX, USA

Chunlei Liu, PhD - University of California Berkeley, CA, USA

  • Laplacian phase unwrapping
  • VSHARP background field removal
  • iHARPERELLA background field removal
  • iLSQR QSM
  • Star-QSM

FANSI Toolbox developed by

Carlos Milovic, PhD - Biomedical Imaging Center at Pontificia Universidad Católica de Chile

Berkin Bilgic, PhD - Martinos Center for Biomedical Imaging, Harvard Medical School, MA, USA

Bo Zhao, PhD - Martinos Center for Biomedical Imaging, Harvard Medical School, MA, USA

Julio Acosta-Cabronero, PhD - Wellcome Trust Centre for Neuroimaging, Institute of Neurology, University College London, London, UK, and German Center for Neurodegenerative Diseases (DZNE), Magdeburg, Germany

Cristian Tejos, PhD - Department of Electrical Engineering, Pontificia Universidad Catolica de Chile, Santiago, Chile and the Biomedical Imaging Center at Pontificia Universidad Católica de Chile

  • FANSI QSM (including both linear and non-linear solvers, and TV and TGV regularisation options)

References

When you use SEPIA in your research, please cite the method(s) that you used:

QSM

TKD Wharton, S., Schäfer, A. & Bowtell, R. Susceptibility mapping in the human brain using threshold-based k-space division. Magn Reson Med 63, 1292–1304 (2010).

Shmueli, K. et al. Magnetic susceptibility mapping of brain tissue in vivo using MRI phase data. Magn Reson Med 62, 1510–1522 (2009).

Closed-form solution Bilgic, B. et al. Fast image reconstruction with L2‐regularization. J Magn Reson Imaging 40, 181–191 (2014).

LSQR Li, W., Wu, B. & Liu, C. Quantitative susceptibility mapping of human brain reflects spatial variation in tissue composition. Neuroimage 55, 1645–1656 (2011).

Star-QSM Wei, H. et al. Streaking artifact reduction for quantitative susceptibility mapping of sources with large dynamic range. NMR Biomed 28, 1294–1303 (2015).

Wei, H. et al. Imaging whole-brain cytoarchitecture of mouse with MRI-based quantitative susceptibility mapping. Neuroimage 137, 107–115 (2016).

Wei, H. et al. Investigating magnetic susceptibility of human knee joint at 7 Tesla. Magn Reson Med 78, 1933–1943 (2017).

FANSI Milovic, C., Bilgic, B., Zhao, B., Acosta-Cabronero, J. & Tejos, C. Fast nonlinear susceptibility inversion with variational regularization. Magn Reson Med 80, 814–821 (2018).

Bilgic, B. et al. Fast quantitative susceptibility mapping with L1‐regularization and automatic parameter selection. Magn Reson Med 72, 1444–1459 (2014).

Bilgic, B., Chatnuntawech, I., Langkammer, C. & Setsompop, K. Sparse methods for Quantitative Susceptibility Mapping. in (eds. Papadakis, M., Goyal, V. K. & Van De Ville, D.) 9597, 959711 (SPIE, 2015).

MEDI Liu, T. et al. Morphology enabled dipole inversion (MEDI) from a single-angle acquisition: Comparison with COSMOS in human brain imaging. Magn Reson Med 66, 777–783 (2011).

Liu, J. et al. Morphology enabled dipole inversion for quantitative susceptibility mapping using structural consistency between the magnitude image and the susceptibility map. Neuroimage 59, 2560–2568 (2012).

Liu, Z., Spincemaille, P., Yao, Y., Zhang, Y. & Wang, Y. MEDI+0: Morphology enabled dipole inversion with automatic uniform cerebrospinal fluid zero reference for quantitative susceptibility mapping. Magn Reson Med 79, 2795–2803 (2018).

NDI Polak D., Chatnuntawech I., Yoon J., Srinivasan Iyer S., Lee J., Setsompop K., and Bilgic B. VaNDI: Variational Nonlinear Dipole Inversion enables QSM without free parameters (program number 0319). Proceedings of the International Society for Magnetic Resonance in Medicine 2019, Montreal Canada

Indices and tables