SNU-LIST / QSMnet

Source code for deep neural network trained quantitative susceptibility mapping (QSMnet and QSMnet+)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QSMnet & QSMnet+

  • The code is for reconstructing Quantitative Susceptibility Mapping by deep neural network (QSMnet) and QSMnet+. QSMnet+ covers a wider range of susceptibility than QSMnet, using data augmentation approach. Data preprocessing, training and inference code of QSMnet (.py) are availabe.
  • The source data for training can be shared to academic institutions. Request should be sent to snu.list.software@gmail.com. For each request, internal approval from our Institutional Review Board (IRB) is required (i.e. takes time).
  • Last update : 2022.06.09

References

Overview

(1) QSMnet

Graphical_abstract

(2) QSMnet+

Figure_QSMnetp

Requirements

  • Python 3.7

  • Tensorflow 1.14.0

  • NVIDIA GPU (CUDA 10.0)

  • MATLAB R2015b

Data acquisition

  • Training data of QSMnet was acquired at 3T MRI (SIEMENS).
  • 3D single-echo GRE scan with following sequence parameters: FOV = 256 x 224 x 176 mm3, voxel size = 1 x 1 x 1 x mm3, TR = 33 ms, TE = 25 ms, bandwidth = 100 Hz/pixel, flip angle = 15°.

Manual

First Time Only

  1. Clone this repository
git clone https://github.com/SNU-LIST/QSMnet.git
  1. Download network
    In Checkpoints directory,
  • For Linux User,
sh download_network.sh
  1. Create conda environment
conda create --name qsmnet -c conda-forge -c anaconda --file requirements.txt 

Phase processing

  • Requirements

    • FSL (Ref: S.M. Smith. Fast robust automated brain extraction. Human brain mapping. 2002 Sep;17(3):143-155.)
    • STI Suite (Ref: W. Li, A.V. Avram, B. Wu, X. Xiao, C. Liu. Integrated Laplacian‐based phase unwrapping and background phase removal for quantitative susceptibility mapping. NMR in Biomedicine. 2014 Dec;27(2):219-227.)
  • Process flow

    • Extract magnitude and phase image from DICOMs
    • Brain extraction : BET (FSL)
    • Phase unwrapping : Laplaican phase unwrapping (STI Suite)
    • Background field removal : 3D V-SHARP (STI Suite)
  • Usage:

    • If you acquired data with different resolution from 1 x 1 x 1 mm3,
      you need to interpolate the data into 1 mm isotropic resolution before phase processing.
      (e.g. zero-padding or truncating in Fourier domain)

    • After 3D V-SHARP in MATLAB, run 'save_input_data_for_QSMnet.m
      '. 'test_input{sub_num}.mat' and 'test_mask{sub_num}.mat' files will be saved in 'Data/Test/Input/'.

      save_input_data_for_QSMnet(TissuePhase, Mask, TE, B0, sub_num)
      % TissuePhase : Results of 3D V-SHARP
      % Mask : Results of 3D V-SHARP
      % TE (s)
      % B0 (T)
      % sub_num : subject number
      % Convert unit from Hz to ppm : field / (Sum(TE) * B0 * gyro) [ppm]
    • Save data with the same orientation and polarity as val_input.mat, val_mask.mat, and val_label.mat files in 'Data/Train/' folder.

Training process

  • Activate qsmnet conda environment

    conda activate qsmnet 
  • Usage

    • Before training, local field & susceptibility maps need to be dividied into 64 x 64 x 64 in Matlab
    python training_data_patch.py
    # PS : Patch size
    # net_name : Network name
    # sub_num : Number of subject to train
    # dir_num : Number of direction per subject
    # patch_num : Number of patches in [x, y, z]
    • Training process in python
    python train.py

Inference

  • Activate qsmnet conda environment
    conda activate qsmnet 
  • Usage
    python inference.py
    • 'subject#<network_name>-epochs.mat' & 'subject#<network_name>-epochs.nii' will be saved after QSMnet reconstruction.

About

Source code for deep neural network trained quantitative susceptibility mapping (QSMnet and QSMnet+)

License:Other


Languages

Language:Python 95.0%Language:Shell 3.2%Language:MATLAB 1.8%