Qsm_sstv pipeline

Source Code: https://github.com/AlanKuurstra/qsm_sstv

Developer will watch for topic posts with the tag: qsm_sstv

Processing

The algorithm assumes no phase singularities in the data. At CFMM, this is accomplished by reconstructing the raw ME-GRE data using an in-house SVD algorithm based on Klassen and Walsh, which gives the least squares best estimate of the magnetization and avoids phase singularities.

QSM processing was performed as follows. Spatial phase unwrapping was accomplished using a 3D best path algorithm. The frequency at each voxel was then estimated by weighted least squares; each phase echo was weighted by the local SNR in the corresponding T2* image. Finally, background removal and dipole inversion were performed simultaneously using a single-step QSM algorithm.

R2* calculation was estimated using nonlinear least squares. Specifically, python’s sipy.optimize.leastsq was used which is a wrapper for MINPACK’s implementation of the Levenberg–Marquardt algorithm. In the signal model (A + 1j * B) * np.exp(-TE * R2star + 1j * f * TE), TE is assumed known, while R2star, frequency f, and the compex amplitude (A + 1j * B) are the unknowns to be estimated. To improve stability, frequency is initialized to the value estimated during qsm processing.

Run Instructions

run_instructions.md

Output

filename-fieldmap
Unwrapped fieldmap in units rad/s without background removal.
filename-QSM
The susceptibility map in units ppb.
Note: due to nature of the dipole inversion problem, susceptibility images have an arbitrary offset. These images have the offset set such that mean value inside the brain is zero. If you plan to compare values between two different images, it is necessary to segment a structure of known susceptibility and set the offset such that the structure obtains that susceptibility (eg. you can segment the ventricles, take the mean susceptibility value inside the ventricles, and subtract that from your QSM image. This applies an offset that forces the mean ventricle value to be zero.)
filename-QSM_brainMask
Where the algorithm believes the brain edge is.
filename-QSM_noiseMask
Voxels that were excluded from the data due to large variance. Usually these are voxels where the phase could not properly be unwrapped, for example near high susceptibility structures like vessels. To reduce the number of voxels masked, increase the value of the input scnd_diff_reliability_thresh_noise.
filename-R2star
The estimated R2star in units Hz from fitting to the complex data.
filename-R2star_fit
A map of how well different voxels were fit.
filename-R2star_negMask
Due to noise, R2star values close to zero can sometimes be estimated as a negative value during the fit. Since this is physically impossible, these voxels are set to be 0 but their locations are recorded in this map.

Hi Alan, thanks for providing this tool!
Is the algorithm affected in any way if we use as input ME-GRE data coming from an animal coil? How does the algorithm locates the correct orientation to simulate the dipole kernel?
Animals (In my case, cats) are mostly standing on the scanner in a sphinx position; therefore, the brain orientation is different from what we would expect from a human brain. Thanks in advance.

Hi Gabriel,

With regards to animal imaging, brain extraction comes to mind. In this bids app if a specific precomputed brain mask file is not provided or if precomputed masks are not stored in the bids folder, then BET is used (see the brain_extract_method argument from the command line help). BET is designed specifically for human imaging, so you’ll want to compute your own masks before running the tool.

An individual mask can be passed using --brain_extract_method SINGLE_SUBJECT_FULL_PATH and --single_subject_custom_mask /path/to/your/custom/mask.

For batch processing a bids directory use --brain_extract_method BIDS and --mask_match_pattern *some_pattern* to have the pipeline search the bids folder and find the appropriate mask files. Because this is an old bids app, the masks should be stored in the bids anat folder with the magnitude and phase data (instead of storing the masks in a derivatives folder). Make sure you set --mask_match_pattern appropriately.

For orientation considerations, please read the B0_dir argument from the command line help.

The command line help can be accessed with:
singularity run qsm_sstv_v2.0.0.sif --help

1 Like