Open In Binder Open In Colab

QSMxT Example#

Author: Ashley Stewart

Original paper: https://onlinelibrary.wiley.com/doi/10.1002/mrm.29048

Setup Neurodesk#

%%capture
import os
import sys
IN_COLAB = 'google.colab' in sys.modules

if IN_COLAB:
  os.environ["LD_PRELOAD"] = "";
  os.environ["APPTAINER_BINDPATH"] = "/content,/tmp,/cvmfs"
  os.environ["MPLCONFIGDIR"] = "/content/matplotlib-mpldir"
  os.environ["LMOD_CMD"] = "/usr/share/lmod/lmod/libexec/lmod"

  !curl -J -O https://raw.githubusercontent.com/NeuroDesk/neurocommand/main/googlecolab_setup.sh
  !chmod +x googlecolab_setup.sh
  !./googlecolab_setup.sh

  os.environ["MODULEPATH"] = ':'.join(map(str, list(map(lambda x: os.path.join(os.path.abspath('/cvmfs/neurodesk.ardc.edu.au/neurodesk-modules/'), x),os.listdir('/cvmfs/neurodesk.ardc.edu.au/neurodesk-modules/')))))
# Output CPU information:
!cat /proc/cpuinfo | grep 'vendor' | uniq
!cat /proc/cpuinfo | grep 'model name' | uniq
vendor_id	: AuthenticAMD
model name	: AMD EPYC 7742 64-Core Processor

QSMxT Interactive Notebook#

This interactive notebook estimates Quantitative Susceptibility Maps (QSMs) for two gradient-echo (GRE) MRI acquisitions using QSMxT provided by the Neurodesk project.

What is QSM?#

QSM is a form of quantitative MRI (qMRI) that estimates the magnetic susceptibility distribution across an imaged object. Magnetic susceptibility is the degree to which a material becomes magnetised by an external magnetic field. Major contributors to susceptibility include iron, calcium, and myelin, with the susceptibility of water typically approximating a zero-reference, though it is slightly diamagnetic. Read more about QSM here.

What is QSMxT?#

QSMxT is a suite of tools for building and running automated pipelines for QSM that:

  • is available open-source without any licensing required;

  • is distributed as a software container making it straightforward to access and install (Neurodesk!)

  • scales its processing to execute across many acquisitions through jobs parallelisation (using multiple processors or HPCs) provided by Nipype;

  • automates steps that usually require manual intervention and scripting, including:

    • DICOM to BIDS conversion;

    • QSM reconstruction using a range of algorithms;

    • segmentation using FastSurfer;

    • group space generation using ANTs;

    • export of susceptibility statistics by subject and region of interest (ROI) to CSV.

image.png

How do I access QSMxT?#

There are a few ways you can access QSMxT:

  • This notebook: You can access QSMxT in this notebook right now!

    • If you are running this on a Neurodesk Play instance, you can upload your own data into the sidebar via drag-and-drop.

  • Neurodesktop: QSMxT is in the applications menu of Neurodesktop.

    • On Neurodesk Play, upload your own data into the desktop via drag-and-drop.

    • On a local install of Neurodesk, bring any necessary files into the shared ~/neurodesktop-storage directory

  • Local install: QSMxT can also be installed via the Docker container

  • HPC install: QSMxT can also be installed via the Singularity container for use on HPCs

Download example DICOMs#

Here, we download some example DICOMs from our OSF repository for QSMxT.

These data include GRE and T1-weighted acquisitions for one subject (duplicated to act as two subjects).

!pip install osfclient
!osf -p ru43c clone . > /dev/null 2>&1
!tar xf osfstorage/dicoms-unsorted.tar
!rm -rf osfstorage/
!tree dicoms-unsorted | head
!echo -e "...\nThere are `ls dicoms-unsorted | wc -l` unsorted DICOMs in ./dicoms-unsorted/"
Requirement already satisfied: osfclient in /opt/conda/lib/python3.10/site-packages (0.0.5)
Requirement already satisfied: requests in /opt/conda/lib/python3.10/site-packages (from osfclient) (2.28.1)
Requirement already satisfied: tqdm in /opt/conda/lib/python3.10/site-packages (from osfclient) (4.64.1)
Requirement already satisfied: six in /opt/conda/lib/python3.10/site-packages (from osfclient) (1.16.0)
Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.10/site-packages (from requests->osfclient) (2022.12.7)
Requirement already satisfied: idna<4,>=2.5 in /opt/conda/lib/python3.10/site-packages (from requests->osfclient) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/conda/lib/python3.10/site-packages (from requests->osfclient) (1.26.13)
Requirement already satisfied: charset-normalizer<3,>=2 in /opt/conda/lib/python3.10/site-packages (from requests->osfclient) (2.1.1)
dicoms-unsorted
├── MR.1.1.dcm
├── MR.1.10.dcm
├── MR.1.100.dcm
├── MR.1.101.dcm
├── MR.1.102.dcm
├── MR.1.103.dcm
├── MR.1.104.dcm
├── MR.1.105.dcm
├── MR.1.106.dcm
...
There are 1216 unsorted DICOMs in ./dicoms-unsorted/

Load QSMxT#

To load QSMxT inside a notebook, we can use the available module system:

import lmod
await lmod.load('qsmxt/4.0.1')
!qsmxt --version
[INFO]: QSMxT v4.0.1

Data standardisation#

QSMxT requires input data to conform to the Brain Imaging Data Structure (BIDS).

Luckily, QSMxT also provides scripts that can convert unorganised NIfTI or DICOM images to BIDS.

Sort DICOMs#

Before we can convert DICOMs to BIDS cleanly, we need to sort the DICOMs by subject, session and series.

We can sort the DICOMs using run_0_dicomSort.py.

Note that this script relies on accurate DICOM header information. If your data is sorted incorrectly, you may need to manually correct the sorting, or sort the files yourself. Be sure to follow the folder structure shown below.

!dicom-sort dicoms-unsorted dicoms-sorted
[INFO]: Running QSMxT 4.0.1
[INFO]: Command: /opt/miniconda-4.7.12.1/bin/dicom-sort dicoms-unsorted dicoms-sorted
[INFO]: Python interpreter: /opt/miniconda-4.7.12.1/bin/python3.8
[INFO]: Reading file list...
[INFO]: 1216 DICOM files found.
[INFO]: Sorting DICOMs in /home/jovyan/example-notebooks/books/structural_imaging/dicoms-sorted...
[INFO]: Identified subject: 1
[INFO]: Identified session: 1 #1 20170705
[INFO]: Identified series: 1/20170705/5_QSM_p2_1mmIso_TE20
[INFO]: Identified session: 2 #1 20170705
[INFO]: Identified series: 2/20170705/5_QSM_p2_1mmIso_TE20
[INFO]: Identified series: 1/20170705/6_mp2rage_highRes_0p5iso_slab
[INFO]: Identified series: 2/20170705/6_QSM_p2_1mmIso_TE20
[INFO]: Identified series: 1/20170705/6_QSM_p2_1mmIso_TE20
[INFO]: Identified series: 2/20170705/6_mp2rage_highRes_0p5iso_slab
[INFO]: Finished

Now we can see clearly that there are two subjects, each with one session, each with three DICOM series:

!tree dicoms-sorted -L 3
dicoms-sorted
├── 1
│   └── 20170705
│       ├── 5_QSM_p2_1mmIso_TE20
│       ├── 6_QSM_p2_1mmIso_TE20
│       └── 6_mp2rage_highRes_0p5iso_slab
├── 2
│   └── 20170705
│       ├── 5_QSM_p2_1mmIso_TE20
│       ├── 6_QSM_p2_1mmIso_TE20
│       └── 6_mp2rage_highRes_0p5iso_slab
├── log_2023-08-28_04-34-57159150.txt
└── references.txt

10 directories, 2 files

Convert to BIDS#

Now that the DICOMs are sorted, we can convert to BIDS using run_1_dicomConvert.py.

The DICOM to BIDS conversion must identify which series should be used for QSM reconstruction (T2*-weighted), and which series should be used for segmentation (T1-weighted). Because this information is not stored in the DICOM header, the user must provide it, or QSMxT can make a guess based on the ProtocolName field. By default, QSMxT assumes series matching any of the patterns in ['*qsm*', '*t2starw*'] are to be used for QSM, and series matching the pattern ['*t1w*'] are to be used for segmentation. If series cannot be identified, the user must do so. At minimum, at least one QSM series must be identified.

If QSMxT is run interactively, the user will be prompted to identify the relevant series’. However, because we are running QSMxT in a notebook, we disable the interactivity using --auto_yes and provide the missing information using command-line arguments (--t1w_protocol_patterns and --t2starw_protocol_patterns). In this case, the T1-weighted scan requires identification, so we pass --t2starw_protocol_patterns "*mp2rage*":

!dicom-convert dicoms-sorted bids \
    --t1w_protocol_patterns "*mp2rage*" \
    --auto_yes
[INFO]: Running QSMxT 4.0.1
[INFO]: Command: /opt/miniconda-4.7.12.1/bin/dicom-convert dicoms-sorted bids --t1w_protocol_patterns *mp2rage* --auto_yes
[INFO]: Python interpreter: /opt/miniconda-4.7.12.1/bin/python3.8
[INFO]: Converting all DICOMs to NIfTI...
[INFO]: Running command: 'dcm2niix -z n -o "/home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/extra_data" "/home/jovyan/example-notebooks/books/structural_imaging/dicoms-sorted/2/20170705/6_QSM_p2_1mmIso_TE20" >> "/home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/extra_data/dcm2niix_output.txt"'
[INFO]: Running command: 'dcm2niix -z n -o "/home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/extra_data" "/home/jovyan/example-notebooks/books/structural_imaging/dicoms-sorted/2/20170705/5_QSM_p2_1mmIso_TE20" >> "/home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/extra_data/dcm2niix_output.txt"'
[INFO]: Running command: 'dcm2niix -z n -o "/home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/extra_data" "/home/jovyan/example-notebooks/books/structural_imaging/dicoms-sorted/2/20170705/6_mp2rage_highRes_0p5iso_slab" >> "/home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/extra_data/dcm2niix_output.txt"'
[INFO]: Running command: 'dcm2niix -z n -o "/home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/extra_data" "/home/jovyan/example-notebooks/books/structural_imaging/dicoms-sorted/1/20170705/6_QSM_p2_1mmIso_TE20" >> "/home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/extra_data/dcm2niix_output.txt"'
[INFO]: Running command: 'dcm2niix -z n -o "/home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/extra_data" "/home/jovyan/example-notebooks/books/structural_imaging/dicoms-sorted/1/20170705/5_QSM_p2_1mmIso_TE20" >> "/home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/extra_data/dcm2niix_output.txt"'
[INFO]: Running command: 'dcm2niix -z n -o "/home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/extra_data" "/home/jovyan/example-notebooks/books/structural_imaging/dicoms-sorted/1/20170705/6_mp2rage_highRes_0p5iso_slab" >> "/home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/extra_data/dcm2niix_output.txt"'
[INFO]: Loading JSON headers from '/home/jovyan/example-notebooks/books/structural_imaging/bids/.../extra_data' folders...
[INFO]: Checking for GE data requiring correction...
[INFO]: Loading updated JSON headers from '/home/jovyan/example-notebooks/books/structural_imaging/bids/.../extra_data' folders...
[INFO]: Enumerating protocol names from JSON headers...
[INFO]: All protocol names identified: ['mp2rage_highres_0p5iso_slab', 'qsm_p2_1mmiso_te20']
[INFO]: Enumerating t2starw protocol names using match patterns ['*t2starw*', '*qsm*']...
[INFO]: Identified the following protocols as t2starw: ['qsm_p2_1mmiso_te20']
[INFO]: Enumerating t1w protocol names using match patterns ['*mp2rage*']...
[INFO]: Identified the following protocols as t1w: ['mp2rage_highres_0p5iso_slab']
[INFO]: Parsing relevant details from JSON headers...
[INFO]: Parsing relevant JSON data from sub-1/ses-20170705...
[INFO]: Parsing relevant JSON data from sub-1/ses-20170705...
[INFO]: Parsing relevant JSON data from sub-2/ses-20170705...
[INFO]: Parsing relevant JSON data from sub-2/ses-20170705...
[INFO]: Renaming files...
[INFO]: Renaming /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/extra_data/6_mp2rage_highRes_0p5iso_slab_mp2rage_highRes_0p5iso_slab_20170705150219_6.json -> /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/anat/sub-1_ses-20170705_acq-mp2ragehighres0p5isoslab_run-01_T1w.json
[INFO]: Renaming /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/extra_data/6_mp2rage_highRes_0p5iso_slab_mp2rage_highRes_0p5iso_slab_20170705150219_6.nii -> /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/anat/sub-1_ses-20170705_acq-mp2ragehighres0p5isoslab_run-01_T1w.nii
[INFO]: Renaming /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/extra_data/5_QSM_p2_1mmIso_TE20_QSM_p2_1mmIso_TE20_20170705134507_5.json -> /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/anat/sub-1_ses-20170705_acq-qsmp21mmisote20_run-01_part-mag_T2starw.json
[INFO]: Renaming /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/extra_data/5_QSM_p2_1mmIso_TE20_QSM_p2_1mmIso_TE20_20170705134507_5.nii -> /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/anat/sub-1_ses-20170705_acq-qsmp21mmisote20_run-01_part-mag_T2starw.nii
[INFO]: Renaming /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/extra_data/6_QSM_p2_1mmIso_TE20_QSM_p2_1mmIso_TE20_20170705134507_6_ph.json -> /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/anat/sub-1_ses-20170705_acq-qsmp21mmisote20_run-01_part-phase_T2starw.json
[INFO]: Renaming /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/extra_data/6_QSM_p2_1mmIso_TE20_QSM_p2_1mmIso_TE20_20170705134507_6_ph.nii -> /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-1/ses-20170705/anat/sub-1_ses-20170705_acq-qsmp21mmisote20_run-01_part-phase_T2starw.nii
[INFO]: Renaming /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/extra_data/6_mp2rage_highRes_0p5iso_slab_mp2rage_highRes_0p5iso_slab_20170705150219_6.json -> /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/anat/sub-2_ses-20170705_acq-mp2ragehighres0p5isoslab_run-01_T1w.json
[INFO]: Renaming /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/extra_data/6_mp2rage_highRes_0p5iso_slab_mp2rage_highRes_0p5iso_slab_20170705150219_6.nii -> /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/anat/sub-2_ses-20170705_acq-mp2ragehighres0p5isoslab_run-01_T1w.nii
[INFO]: Renaming /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/extra_data/5_QSM_p2_1mmIso_TE20_QSM_p2_1mmIso_TE20_20170705134507_5.json -> /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/anat/sub-2_ses-20170705_acq-qsmp21mmisote20_run-01_part-mag_T2starw.json
[INFO]: Renaming /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/extra_data/5_QSM_p2_1mmIso_TE20_QSM_p2_1mmIso_TE20_20170705134507_5.nii -> /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/anat/sub-2_ses-20170705_acq-qsmp21mmisote20_run-01_part-mag_T2starw.nii
[INFO]: Renaming /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/extra_data/6_QSM_p2_1mmIso_TE20_QSM_p2_1mmIso_TE20_20170705134507_6_ph.json -> /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/anat/sub-2_ses-20170705_acq-qsmp21mmisote20_run-01_part-phase_T2starw.json
[INFO]: Renaming /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/extra_data/6_QSM_p2_1mmIso_TE20_QSM_p2_1mmIso_TE20_20170705134507_6_ph.nii -> /home/jovyan/example-notebooks/books/structural_imaging/bids/sub-2/ses-20170705/anat/sub-2_ses-20170705_acq-qsmp21mmisote20_run-01_part-phase_T2starw.nii
[INFO]: Generating details for BIDS datset_description.json...
[INFO]: Writing BIDS dataset_description.json...
[INFO]: Writing BIDS .bidsignore file...
[INFO]: Writing BIDS dataset README...
[INFO]: Finished
!tree bids
bids
├── README
├── dataset_description.json
├── log_2023-08-28_04-35-04600783.txt
├── references.txt
├── sub-1
│   └── ses-20170705
│       ├── anat
│       │   ├── sub-1_ses-20170705_acq-mp2ragehighres0p5isoslab_run-01_T1w.json
│       │   ├── sub-1_ses-20170705_acq-mp2ragehighres0p5isoslab_run-01_T1w.nii
│       │   ├── sub-1_ses-20170705_acq-qsmp21mmisote20_run-01_part-mag_T2starw.json
│       │   ├── sub-1_ses-20170705_acq-qsmp21mmisote20_run-01_part-mag_T2starw.nii
│       │   ├── sub-1_ses-20170705_acq-qsmp21mmisote20_run-01_part-phase_T2starw.json
│       │   └── sub-1_ses-20170705_acq-qsmp21mmisote20_run-01_part-phase_T2starw.nii
│       └── extra_data
│           └── dcm2niix_output.txt
└── sub-2
    └── ses-20170705
        ├── anat
        │   ├── sub-2_ses-20170705_acq-mp2ragehighres0p5isoslab_run-01_T1w.json
        │   ├── sub-2_ses-20170705_acq-mp2ragehighres0p5isoslab_run-01_T1w.nii
        │   ├── sub-2_ses-20170705_acq-qsmp21mmisote20_run-01_part-mag_T2starw.json
        │   ├── sub-2_ses-20170705_acq-qsmp21mmisote20_run-01_part-mag_T2starw.nii
        │   ├── sub-2_ses-20170705_acq-qsmp21mmisote20_run-01_part-phase_T2starw.json
        │   └── sub-2_ses-20170705_acq-qsmp21mmisote20_run-01_part-phase_T2starw.nii
        └── extra_data
            └── dcm2niix_output.txt

8 directories, 18 files

Inspect input data#

Here we define a function we will use to visualise NIfTI images so we can view some of the input data:

def show_nii(nii_path, title=None, cmap='gray', **imshow_args):
    from matplotlib import pyplot as plt
    import numpy as np
    import nibabel as nib
    import glob

    # load data
    data_1 = nib.load(nii_path).get_fdata()

    # get middle slices
    slc_data1 = np.rot90(data_1[np.shape(data_1)[0]//2,:,:])
    slc_data2 = np.rot90(data_1[:,np.shape(data_1)[1]//2,:])
    slc_data3 = np.rot90(data_1[:,:,np.shape(data_1)[2]//2])

    # show slices
    fig, axes = plt.subplots(nrows=1, ncols=3, figsize=(8,10))
    if title: plt.suptitle(title)

    axes[0].imshow(slc_data1, cmap=cmap, **imshow_args)
    axes[1].imshow(slc_data2, cmap=cmap, **imshow_args)
    axes[2].imshow(slc_data3, cmap=cmap, **imshow_args)

    axes[0].axis('off')
    axes[1].axis('off')
    axes[2].axis('off')

    fig.tight_layout()
    fig.subplots_adjust(top=1.55)
    plt.show()
from glob import glob
show_nii(glob("bids/sub-*/ses-*/anat/*mag*nii*")[0], title="Magnitude", vmax=500)
show_nii(glob("bids/sub-*/ses-*/anat/*phase*nii*")[0], title="Phase")
show_nii(glob("bids/sub-*/ses-*/anat/*T1w*nii*")[0], title="T1-weighted")
../_images/95d92e214d33b6d513ba311ef142d52fbf22eec4c00cce38001637a416a16bff.png ../_images/48e70459112b7c835fb0c1538c23f56aee55c39d80886a0edc3f3a4594b862eb.png ../_images/17209dbffa2e265406d5670a0392a2fe2f0e4df621cb156a11af29f6d3fac848.png

Run QSMxT#

We are now ready to run QSMxT! We will generate susceptibility maps and segmentations, and export analysis CSVs to file.

The usual way of running QSMxT is to use qsmxt bids_dir output_dir. This will launch an interactive command-line interface (CLI) to setup your desired pipelines. However, since we are running this in a notebook, we need to use command-line arguments to by-pass the interface and execute a pipeline.

But first, let’s consider our pipeline settings. For QSM reconstruction, QSMxT provides a range of sensible defaults fit for different purposes. We can list the premade QSM pipelines using --list_premades. For the full pipeline details used for each premade pipeline, see qsm_pipelines.json.

!qsmxt --list_premades
[INFO]: QSMxT v4.0.1
[INFO]: Parsing arguments...
=== Premade pipelines ===
default: Default QSMxT settings (GRE; assumes human brain)
gre: Applies suggested settings for 3D-GRE images
epi: Applies suggested settings for 3D-EPI images (assumes human brain)
bet: Applies a traditional BET-masking approach (artefact reduction unavailable; assumes human brain)
fast: Applies a set of fast algorithms
body: Applies suggested settings for non-brain applications
nextqsm: Applies suggested settings for running the NeXtQSM algorithm (assumes human brain)
[INFO]: Finished

For this demonstration, we will go with the fast pipeline. To export segmentations and analysis results, we will use --do_segmentation and --do_analysis. The --auto_yes option avoid the interactive CLI interface that cannot be used in a notebook:

!qsmxt bids qsm \
    --premade fast \
    --do_qsm \
    --do_segmentation \
    --do_analysis \
    --auto_yes
[INFO]: QSMxT v4.0.1
[INFO]: Parsing arguments...
[INFO]: Starting log file: /home/jovyan/example-notebooks/books/structural_imaging/qsm/qsmxt.log
[INFO]: Python interpreter: /opt/miniconda-4.7.12.1/bin/python3.8
[INFO]: Command: qsmxt /home/jovyan/example-notebooks/books/structural_imaging/bids /home/jovyan/example-notebooks/books/structural_imaging/qsm --premade 'fast' --do_qsm --do_segmentation --do_analysis --auto_yes
[INFO]: Creating QSMxT workflow for sub-1.ses-20170705.acq-qsmp21mmisote20.run-01...
[INFO]: Creating QSMxT workflow for sub-2.ses-20170705.acq-qsmp21mmisote20.run-01...
[INFO]: Running using MultiProc plugin with n_procs=16
230828-04:35:13,525 nipype.workflow INFO:
	 Workflow workflow settings: ['check', 'execution', 'logging', 'monitoring']
230828-04:35:13,548 nipype.workflow INFO:
	 Running in parallel.
230828-04:35:13,551 nipype.workflow INFO:
	 [MultiProc] Running 0 tasks, and 12 jobs ready. Free memory (GB): 224.31/224.31, Free processors: 16/16.
230828-04:35:13,696 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.func_read-json-me" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/func_read-json-me".
230828-04:35:13,697 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.func_read-json-me" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/func_read-json-me".
230828-04:35:13,698 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/fastsurfer_segment-t1".
230828-04:35:13,701 nipype.workflow INFO:
	 [Node] Executing "func_read-json-me" <nipype.interfaces.utility.wrappers.Function>
230828-04:35:13,701 nipype.workflow INFO:
	 [Node] Executing "func_read-json-me" <nipype.interfaces.utility.wrappers.Function>
230828-04:35:13,702 nipype.workflow INFO:
	 [Node] Executing "fastsurfer_segment-t1" <qsmxt.interfaces.nipype_interface_fastsurfer.FastSurferInterface>
230828-04:35:13,703 nipype.workflow INFO:
	 [Node] Finished "func_read-json-me", elapsed time 0.000906s.
230828-04:35:13,704 nipype.workflow INFO:
	 [Node] Finished "func_read-json-me", elapsed time 0.000775s.
230828-04:35:13,696 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.func_read-json-se" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/func_read-json-se".
230828-04:35:13,697 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_numpy_scale-phase" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/nibabel_numpy_scale-phase".
230828-04:35:13,699 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_numpy_scale-phase" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/nibabel_numpy_scale-phase".
230828-04:35:13,752 nipype.workflow INFO:
	 [Node] Executing "func_read-json-se" <nipype.interfaces.utility.wrappers.Function>
230828-04:35:13,752 nipype.workflow INFO:
	 [Node] Executing "nibabel_numpy_scale-phase" <qsmxt.interfaces.nipype_interface_processphase.ScalePhaseInterface>
230828-04:35:13,753 nipype.workflow INFO:
	 [Node] Executing "nibabel_numpy_scale-phase" <qsmxt.interfaces.nipype_interface_processphase.ScalePhaseInterface>
230828-04:35:13,756 nipype.workflow INFO:
	 [Node] Finished "func_read-json-se", elapsed time 0.001198s.
230828-04:35:13,696 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_read-nii" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/nibabel_read-nii".
230828-04:35:13,698 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.func_read-json-se" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/func_read-json-se".
230828-04:35:13,803 nipype.workflow INFO:
	 [Node] Executing "nibabel_read-nii" <nipype.interfaces.utility.wrappers.Function>
230828-04:35:13,804 nipype.workflow INFO:
	 [Node] Executing "func_read-json-se" <nipype.interfaces.utility.wrappers.Function>
230828-04:35:13,808 nipype.workflow INFO:
	 [Node] Finished "func_read-json-se", elapsed time 0.00116s.
230828-04:35:13,810 nipype.workflow INFO:
	 [Node] Finished "nibabel_read-nii", elapsed time 0.00416s.
230828-04:35:13,698 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_read-nii" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/nibabel_read-nii".
230828-04:35:13,857 nipype.workflow INFO:
	 [Node] Executing "nibabel_read-nii" <nipype.interfaces.utility.wrappers.Function>
230828-04:35:13,869 nipype.workflow INFO:
	 [Node] Finished "nibabel_read-nii", elapsed time 0.006675s.
230828-04:35:14,58 nipype.workflow INFO:
	 [Node] Finished "nibabel_numpy_scale-phase", elapsed time 0.303693s.
230828-04:35:14,98 nipype.workflow INFO:
	 [Node] Finished "nibabel_numpy_scale-phase", elapsed time 0.344043s.
230828-04:35:15,553 nipype.workflow INFO:
	 [Job 0] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.func_read-json-me).
230828-04:35:15,557 nipype.workflow INFO:
	 [Job 1] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.func_read-json-se).
230828-04:35:15,558 nipype.workflow INFO:
	 [Job 2] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_read-nii).
230828-04:35:15,559 nipype.workflow INFO:
	 [Job 3] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_numpy_scale-phase).
230828-04:35:15,559 nipype.workflow INFO:
	 [Job 6] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.func_read-json-me).
230828-04:35:15,560 nipype.workflow INFO:
	 [Job 7] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.func_read-json-se).
230828-04:35:15,561 nipype.workflow INFO:
	 [Job 8] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_read-nii).
230828-04:35:15,562 nipype.workflow INFO:
	 [Job 9] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_numpy_scale-phase).
230828-04:35:15,563 nipype.workflow INFO:
	 [MultiProc] Running 1 tasks, and 5 jobs ready. Free memory (GB): 212.31/224.31, Free processors: 8/16.
                     Currently running:
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:35:15,650 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_as-canonical" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/nibabel_as-canonical".
230828-04:35:15,651 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/ants_register-t1-to-qsm".
230828-04:35:15,655 nipype.workflow INFO:
	 [Node] Executing "ants_register-t1-to-qsm" <nipype.interfaces.ants.registration.RegistrationSynQuick>
230828-04:35:15,655 nipype.workflow INFO:
	 [Node] Executing "nibabel_as-canonical" <nipype.interfaces.utility.wrappers.Function>
230828-04:35:15,662 nipype.workflow INFO:
	 [Node] Finished "nibabel_as-canonical", elapsed time 0.005357s.
230828-04:35:15,651 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_as-canonical" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/nibabel_as-canonical".
230828-04:35:15,706 nipype.workflow INFO:
	 [Node] Executing "nibabel_as-canonical" <nipype.interfaces.utility.wrappers.Function>
230828-04:35:15,713 nipype.workflow INFO:
	 [Node] Finished "nibabel_as-canonical", elapsed time 0.005018s.
230828-04:35:17,554 nipype.workflow INFO:
	 [Job 12] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_as-canonical).
230828-04:35:17,556 nipype.workflow INFO:
	 [Job 14] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_as-canonical).
230828-04:35:17,557 nipype.workflow INFO:
	 [MultiProc] Running 2 tasks, and 4 jobs ready. Free memory (GB): 208.31/224.31, Free processors: 2/16.
                     Currently running:
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:35:17,631 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_numpy_nilearn_axial-resampling" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/nibabel_numpy_nilearn_axial-resampling".
230828-04:35:17,636 nipype.workflow INFO:
	 [Node] Executing "nibabel_numpy_nilearn_axial-resampling" <qsmxt.interfaces.nipype_interface_axialsampling.AxialSamplingInterface>
230828-04:35:17,641 nipype.workflow INFO:
	 [Node] Finished "nibabel_numpy_nilearn_axial-resampling", elapsed time 0.003622s.
230828-04:35:17,631 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_numpy_nilearn_axial-resampling" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/nibabel_numpy_nilearn_axial-resampling".
230828-04:35:17,687 nipype.workflow INFO:
	 [Node] Executing "nibabel_numpy_nilearn_axial-resampling" <qsmxt.interfaces.nipype_interface_axialsampling.AxialSamplingInterface>
230828-04:35:17,693 nipype.workflow INFO:
	 [Node] Finished "nibabel_numpy_nilearn_axial-resampling", elapsed time 0.004081s.
230828-04:35:19,557 nipype.workflow INFO:
	 [Job 16] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_numpy_nilearn_axial-resampling).
230828-04:35:19,558 nipype.workflow INFO:
	 [Job 18] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_numpy_nilearn_axial-resampling).
230828-04:35:19,560 nipype.workflow INFO:
	 [MultiProc] Running 2 tasks, and 6 jobs ready. Free memory (GB): 208.31/224.31, Free processors: 2/16.
                     Currently running:
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:35:19,639 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.mask_workflow.fsl-bet" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/mask_workflow/fsl-bet".
230828-04:35:19,645 nipype.workflow INFO:
	 [Node] Executing "fsl-bet" <qsmxt.interfaces.nipype_interface_bet2.Bet2Interface>
230828-04:35:19,639 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.mrt_romeo" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/qsm_workflow/mrt_romeo".
230828-04:35:19,696 nipype.workflow INFO:
	 [Node] Executing "mrt_romeo" <qsmxt.interfaces.nipype_interface_romeo.RomeoB0Interface>
230828-04:35:21,559 nipype.workflow INFO:
	 [MultiProc] Running 4 tasks, and 4 jobs ready. Free memory (GB): 205.11/224.31, Free processors: 0/16.
                     Currently running:
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.mrt_romeo
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.mask_workflow.fsl-bet
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:35:37,966 nipype.workflow INFO:
	 [Node] Finished "fsl-bet", elapsed time 18.319006s.
230828-04:35:39,576 nipype.workflow INFO:
	 [Job 20] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.mask_workflow.fsl-bet).
230828-04:35:39,578 nipype.workflow INFO:
	 [MultiProc] Running 3 tasks, and 5 jobs ready. Free memory (GB): 205.31/224.31, Free processors: 1/16.
                     Currently running:
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.mrt_romeo
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:35:39,696 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.mask_workflow.fsl-bet" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/mask_workflow/fsl-bet".
230828-04:35:39,700 nipype.workflow INFO:
	 [Node] Executing "fsl-bet" <qsmxt.interfaces.nipype_interface_bet2.Bet2Interface>
230828-04:35:41,581 nipype.workflow INFO:
	 [MultiProc] Running 4 tasks, and 4 jobs ready. Free memory (GB): 205.11/224.31, Free processors: 0/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.mask_workflow.fsl-bet
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.mrt_romeo
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:36:01,343 nipype.workflow INFO:
	 [Node] Finished "fsl-bet", elapsed time 21.64109s.
230828-04:36:01,598 nipype.workflow INFO:
	 [Job 22] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.mask_workflow.fsl-bet).
230828-04:36:01,600 nipype.workflow INFO:
	 [MultiProc] Running 3 tasks, and 5 jobs ready. Free memory (GB): 205.31/224.31, Free processors: 1/16.
                     Currently running:
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.mrt_romeo
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:36:01,682 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.mrt_romeo" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/qsm_workflow/mrt_romeo".
230828-04:36:01,687 nipype.workflow INFO:
	 [Node] Executing "mrt_romeo" <qsmxt.interfaces.nipype_interface_romeo.RomeoB0Interface>
230828-04:36:03,601 nipype.workflow INFO:
	 [MultiProc] Running 4 tasks, and 4 jobs ready. Free memory (GB): 202.31/224.31, Free processors: 0/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.mrt_romeo
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.mrt_romeo
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:36:43,673 nipype.workflow INFO:
	 [Node] Finished "mrt_romeo", elapsed time 83.975405s.
230828-04:36:45,644 nipype.workflow INFO:
	 [Job 21] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.mrt_romeo).
230828-04:36:45,646 nipype.workflow INFO:
	 [MultiProc] Running 3 tasks, and 5 jobs ready. Free memory (GB): 205.31/224.31, Free processors: 1/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.mrt_romeo
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:36:45,722 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.mask_workflow.scipy_numpy_nibabel_bet_erode" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/mask_workflow/scipy_numpy_nibabel_bet_erode".
230828-04:36:45,726 nipype.workflow INFO:
	 [Node] Executing "scipy_numpy_nibabel_bet_erode" <qsmxt.interfaces.nipype_interface_erode.ErosionInterface>
230828-04:36:46,743 nipype.workflow INFO:
	 [Node] Finished "scipy_numpy_nibabel_bet_erode", elapsed time 1.015187s.
230828-04:36:47,646 nipype.workflow INFO:
	 [Job 24] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.mask_workflow.scipy_numpy_nibabel_bet_erode).
230828-04:36:47,649 nipype.workflow INFO:
	 [MultiProc] Running 3 tasks, and 4 jobs ready. Free memory (GB): 205.31/224.31, Free processors: 1/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.mrt_romeo
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:36:47,739 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.nibabel-numpy_normalize-phase" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/qsm_workflow/nibabel-numpy_normalize-phase".
230828-04:36:47,744 nipype.workflow INFO:
	 [Node] Executing "nibabel-numpy_normalize-phase" <qsmxt.interfaces.nipype_interface_processphase.PhaseToNormalizedInterface>
230828-04:36:47,875 nipype.workflow INFO:
	 [Node] Finished "nibabel-numpy_normalize-phase", elapsed time 0.129563s.
230828-04:36:49,648 nipype.workflow INFO:
	 [Job 25] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.nibabel-numpy_normalize-phase).
230828-04:36:49,650 nipype.workflow INFO:
	 [MultiProc] Running 3 tasks, and 4 jobs ready. Free memory (GB): 205.31/224.31, Free processors: 1/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.mrt_romeo
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:36:49,783 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.mask_workflow.scipy_numpy_nibabel_bet_erode" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/mask_workflow/scipy_numpy_nibabel_bet_erode".
230828-04:36:49,786 nipype.workflow INFO:
	 [Node] Executing "scipy_numpy_nibabel_bet_erode" <qsmxt.interfaces.nipype_interface_erode.ErosionInterface>
230828-04:36:50,535 nipype.workflow INFO:
	 [Node] Finished "scipy_numpy_nibabel_bet_erode", elapsed time 0.74824s.
230828-04:36:51,650 nipype.workflow INFO:
	 [Job 26] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.mask_workflow.scipy_numpy_nibabel_bet_erode).
230828-04:36:51,653 nipype.workflow INFO:
	 [MultiProc] Running 3 tasks, and 3 jobs ready. Free memory (GB): 205.31/224.31, Free processors: 1/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.mrt_romeo
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:37:22,996 nipype.workflow INFO:
	 [Node] Finished "mrt_romeo", elapsed time 81.307695s.
230828-04:37:23,680 nipype.workflow INFO:
	 [Job 23] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.mrt_romeo).
230828-04:37:23,682 nipype.workflow INFO:
	 [MultiProc] Running 2 tasks, and 4 jobs ready. Free memory (GB): 208.31/224.31, Free processors: 2/16.
                     Currently running:
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:37:23,788 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.nibabel-numpy_normalize-phase" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/qsm_workflow/nibabel-numpy_normalize-phase".
230828-04:37:23,793 nipype.workflow INFO:
	 [Node] Executing "nibabel-numpy_normalize-phase" <qsmxt.interfaces.nipype_interface_processphase.PhaseToNormalizedInterface>
230828-04:37:23,882 nipype.workflow INFO:
	 [Node] Finished "nibabel-numpy_normalize-phase", elapsed time 0.087916s.
230828-04:37:25,682 nipype.workflow INFO:
	 [Job 27] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.nibabel-numpy_normalize-phase).
230828-04:37:25,684 nipype.workflow INFO:
	 [MultiProc] Running 2 tasks, and 4 jobs ready. Free memory (GB): 208.31/224.31, Free processors: 2/16.
                     Currently running:
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:37:25,758 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.qsmjl_vsharp" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/qsm_workflow/qsmjl_vsharp".
230828-04:37:25,763 nipype.workflow INFO:
	 [Node] Executing "qsmjl_vsharp" <qsmxt.interfaces.nipype_interface_qsmjl.VsharpInterface>
230828-04:37:27,685 nipype.workflow INFO:
	 [MultiProc] Running 3 tasks, and 3 jobs ready. Free memory (GB): 208.11/224.31, Free processors: 0/16.
                     Currently running:
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.qsmjl_vsharp
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:37:57,37 nipype.workflow INFO:
	 [Node] Finished "qsmjl_vsharp", elapsed time 31.272988s.
230828-04:37:57,715 nipype.workflow INFO:
	 [Job 28] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.qsmjl_vsharp).
230828-04:37:57,717 nipype.workflow INFO:
	 [MultiProc] Running 2 tasks, and 4 jobs ready. Free memory (GB): 208.31/224.31, Free processors: 2/16.
                     Currently running:
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:37:57,780 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.qsmjl_vsharp" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/qsm_workflow/qsmjl_vsharp".
230828-04:37:57,784 nipype.workflow INFO:
	 [Node] Executing "qsmjl_vsharp" <qsmxt.interfaces.nipype_interface_qsmjl.VsharpInterface>
230828-04:37:59,44 nipype.workflow INFO:
	 [Node] Finished "ants_register-t1-to-qsm", elapsed time 163.387414s.
230828-04:37:59,716 nipype.workflow INFO:
	 [Job 5] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm).
230828-04:37:59,720 nipype.workflow INFO:
	 [MultiProc] Running 2 tasks, and 3 jobs ready. Free memory (GB): 212.11/224.31, Free processors: 6/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.qsmjl_vsharp
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:37:59,811 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/ants_register-t1-to-qsm".
230828-04:37:59,815 nipype.workflow INFO:
	 [Node] Executing "ants_register-t1-to-qsm" <nipype.interfaces.ants.registration.RegistrationSynQuick>
230828-04:38:01,719 nipype.workflow INFO:
	 [MultiProc] Running 3 tasks, and 2 jobs ready. Free memory (GB): 208.11/224.31, Free processors: 0/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.qsmjl_vsharp
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:38:34,144 nipype.workflow INFO:
	 [Node] Finished "qsmjl_vsharp", elapsed time 36.359187s.
230828-04:38:35,756 nipype.workflow INFO:
	 [Job 29] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.qsmjl_vsharp).
230828-04:38:35,757 nipype.workflow INFO:
	 [MultiProc] Running 2 tasks, and 3 jobs ready. Free memory (GB): 208.31/224.31, Free processors: 2/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:38:35,819 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.qsmjl_rts" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/qsm_workflow/qsmjl_rts".
230828-04:38:35,823 nipype.workflow INFO:
	 [Node] Executing "qsmjl_rts" <qsmxt.interfaces.nipype_interface_qsmjl.RtsQsmInterface>
230828-04:38:37,759 nipype.workflow INFO:
	 [MultiProc] Running 3 tasks, and 2 jobs ready. Free memory (GB): 208.11/224.31, Free processors: 0/16.
                     Currently running:
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.qsmjl_rts
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:39:27,976 nipype.workflow INFO:
	 [Node] Finished "qsmjl_rts", elapsed time 52.152571s.
230828-04:39:29,810 nipype.workflow INFO:
	 [Job 30] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.qsmjl_rts).
230828-04:39:29,812 nipype.workflow INFO:
	 [MultiProc] Running 2 tasks, and 3 jobs ready. Free memory (GB): 208.31/224.31, Free processors: 2/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:39:29,883 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.qsmjl_rts" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/qsm_workflow/qsmjl_rts".
230828-04:39:29,888 nipype.workflow INFO:
	 [Node] Executing "qsmjl_rts" <qsmxt.interfaces.nipype_interface_qsmjl.RtsQsmInterface>
230828-04:39:31,813 nipype.workflow INFO:
	 [MultiProc] Running 3 tasks, and 2 jobs ready. Free memory (GB): 208.11/224.31, Free processors: 0/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.qsmjl_rts
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:40:08,709 nipype.workflow INFO:
	 [Node] Finished "qsmjl_rts", elapsed time 38.820015s.
230828-04:40:09,849 nipype.workflow INFO:
	 [Job 31] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsm_workflow.qsmjl_rts).
230828-04:40:09,851 nipype.workflow INFO:
	 [MultiProc] Running 2 tasks, and 3 jobs ready. Free memory (GB): 208.31/224.31, Free processors: 2/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:40:09,918 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_numpy_qsm-average" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/nibabel_numpy_qsm-average".
230828-04:40:09,919 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_numpy_qsm-average" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/nibabel_numpy_qsm-average".
230828-04:40:09,923 nipype.workflow INFO:
	 [Node] Executing "nibabel_numpy_qsm-average" <qsmxt.interfaces.nipype_interface_nonzeroaverage.NonzeroAverageInterface>
230828-04:40:09,925 nipype.workflow INFO:
	 [Node] Finished "nibabel_numpy_qsm-average", elapsed time 0.000199s.
230828-04:40:09,923 nipype.workflow INFO:
	 [Node] Executing "nibabel_numpy_qsm-average" <qsmxt.interfaces.nipype_interface_nonzeroaverage.NonzeroAverageInterface>
230828-04:40:09,976 nipype.workflow INFO:
	 [Node] Finished "nibabel_numpy_qsm-average", elapsed time 0.000275s.
230828-04:40:11,852 nipype.workflow INFO:
	 [Job 32] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_numpy_qsm-average).
230828-04:40:11,853 nipype.workflow INFO:
	 [Job 33] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.nibabel_numpy_qsm-average).
230828-04:40:11,854 nipype.workflow INFO:
	 [MultiProc] Running 2 tasks, and 1 jobs ready. Free memory (GB): 208.31/224.31, Free processors: 2/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:40:22,899 nipype.workflow INFO:
	 [Node] Finished "fastsurfer_segment-t1", elapsed time 309.19496s.
230828-04:40:23,862 nipype.workflow INFO:
	 [Job 4] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1).
230828-04:40:23,864 nipype.workflow INFO:
	 [MultiProc] Running 1 tasks, and 2 jobs ready. Free memory (GB): 220.31/224.31, Free processors: 10/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
230828-04:40:23,931 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.numpy_numpy_nibabel_mgz2nii" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/numpy_numpy_nibabel_mgz2nii".
230828-04:40:23,934 nipype.workflow INFO:
	 [Node] Executing "numpy_numpy_nibabel_mgz2nii" <qsmxt.interfaces.nipype_interface_mgz2nii.Mgz2NiiInterface>
230828-04:40:23,931 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/fastsurfer_segment-t1".
230828-04:40:23,985 nipype.workflow INFO:
	 [Node] Executing "fastsurfer_segment-t1" <qsmxt.interfaces.nipype_interface_fastsurfer.FastSurferInterface>
230828-04:40:24,90 nipype.workflow INFO:
	 [Node] Finished "numpy_numpy_nibabel_mgz2nii", elapsed time 0.155075s.
230828-04:40:25,864 nipype.workflow INFO:
	 [Job 13] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.numpy_numpy_nibabel_mgz2nii).
230828-04:40:25,866 nipype.workflow INFO:
	 [MultiProc] Running 2 tasks, and 1 jobs ready. Free memory (GB): 208.31/224.31, Free processors: 2/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
230828-04:40:25,934 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_transform-segmentation-to-qsm" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/ants_transform-segmentation-to-qsm".
230828-04:40:25,939 nipype.workflow INFO:
	 [Node] Executing "ants_transform-segmentation-to-qsm" <nipype.interfaces.ants.resampling.ApplyTransforms>
230828-04:40:26,419 nipype.workflow INFO:
	 [Node] Finished "ants_transform-segmentation-to-qsm", elapsed time 0.47849s.
230828-04:40:27,867 nipype.workflow INFO:
	 [Job 17] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_transform-segmentation-to-qsm).
230828-04:40:27,869 nipype.workflow INFO:
	 [MultiProc] Running 2 tasks, and 1 jobs ready. Free memory (GB): 208.31/224.31, Free processors: 2/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
230828-04:40:27,937 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.analyse_qsm" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/analyse_qsm".
230828-04:40:27,940 nipype.workflow INFO:
	 [Node] Executing "analyse_qsm" <qsmxt.interfaces.nipype_interface_analyse.AnalyseInterface>
230828-04:40:29,868 nipype.workflow INFO:
	 [MultiProc] Running 3 tasks, and 0 jobs ready. Free memory (GB): 208.11/224.31, Free processors: 1/16.
                     Currently running:
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.analyse_qsm
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm
230828-04:40:31,734 nipype.workflow INFO:
	 [Node] Finished "ants_register-t1-to-qsm", elapsed time 151.917078s.
230828-04:40:31,869 nipype.workflow INFO:
	 [Job 11] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_register-t1-to-qsm).
230828-04:40:31,871 nipype.workflow INFO:
	 [MultiProc] Running 2 tasks, and 0 jobs ready. Free memory (GB): 212.11/224.31, Free processors: 7/16.
                     Currently running:
                       * workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.analyse_qsm
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:41:17,654 nipype.workflow INFO:
	 [Node] Finished "analyse_qsm", elapsed time 49.712754s.
230828-04:41:17,912 nipype.workflow INFO:
	 [Job 34] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.analyse_qsm).
230828-04:41:17,915 nipype.workflow INFO:
	 [MultiProc] Running 1 tasks, and 1 jobs ready. Free memory (GB): 212.31/224.31, Free processors: 8/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:41:18,7 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsmxt_datasink" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-1/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/qsmxt_datasink".
230828-04:41:18,15 nipype.workflow INFO:
	 [Node] Executing "qsmxt_datasink" <nipype.interfaces.io.DataSink>
230828-04:41:18,19 nipype.workflow INFO:
	 [Node] Finished "qsmxt_datasink", elapsed time 0.001726s.
230828-04:41:19,914 nipype.workflow INFO:
	 [Job 36] Completed (workflow.sub-1.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsmxt_datasink).
230828-04:41:19,916 nipype.workflow INFO:
	 [MultiProc] Running 1 tasks, and 0 jobs ready. Free memory (GB): 212.31/224.31, Free processors: 8/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1
230828-04:45:06,118 nipype.workflow INFO:
	 [Node] Finished "fastsurfer_segment-t1", elapsed time 282.130935s.
230828-04:45:06,137 nipype.workflow INFO:
	 [Job 10] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.fastsurfer_segment-t1).
230828-04:45:06,138 nipype.workflow INFO:
	 [MultiProc] Running 0 tasks, and 1 jobs ready. Free memory (GB): 224.31/224.31, Free processors: 16/16.
230828-04:45:06,203 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.numpy_numpy_nibabel_mgz2nii" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/numpy_numpy_nibabel_mgz2nii".
230828-04:45:06,206 nipype.workflow INFO:
	 [Node] Executing "numpy_numpy_nibabel_mgz2nii" <qsmxt.interfaces.nipype_interface_mgz2nii.Mgz2NiiInterface>
230828-04:45:06,355 nipype.workflow INFO:
	 [Node] Finished "numpy_numpy_nibabel_mgz2nii", elapsed time 0.148772s.
230828-04:45:08,139 nipype.workflow INFO:
	 [Job 15] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.numpy_numpy_nibabel_mgz2nii).
230828-04:45:08,141 nipype.workflow INFO:
	 [MultiProc] Running 0 tasks, and 1 jobs ready. Free memory (GB): 224.31/224.31, Free processors: 16/16.
230828-04:45:08,208 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_transform-segmentation-to-qsm" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/ants_transform-segmentation-to-qsm".
230828-04:45:08,212 nipype.workflow INFO:
	 [Node] Executing "ants_transform-segmentation-to-qsm" <nipype.interfaces.ants.resampling.ApplyTransforms>
230828-04:45:08,588 nipype.workflow INFO:
	 [Node] Finished "ants_transform-segmentation-to-qsm", elapsed time 0.374952s.
230828-04:45:10,141 nipype.workflow INFO:
	 [Job 19] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.ants_transform-segmentation-to-qsm).
230828-04:45:10,143 nipype.workflow INFO:
	 [MultiProc] Running 0 tasks, and 1 jobs ready. Free memory (GB): 224.31/224.31, Free processors: 16/16.
230828-04:45:10,209 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.analyse_qsm" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/analyse_qsm".
230828-04:45:10,213 nipype.workflow INFO:
	 [Node] Executing "analyse_qsm" <qsmxt.interfaces.nipype_interface_analyse.AnalyseInterface>
230828-04:45:12,144 nipype.workflow INFO:
	 [MultiProc] Running 1 tasks, and 0 jobs ready. Free memory (GB): 224.11/224.31, Free processors: 15/16.
                     Currently running:
                       * workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.analyse_qsm
230828-04:45:52,979 nipype.workflow INFO:
	 [Node] Finished "analyse_qsm", elapsed time 42.764791s.
230828-04:45:54,185 nipype.workflow INFO:
	 [Job 35] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.analyse_qsm).
230828-04:45:54,186 nipype.workflow INFO:
	 [MultiProc] Running 0 tasks, and 1 jobs ready. Free memory (GB): 224.31/224.31, Free processors: 16/16.
230828-04:45:54,251 nipype.workflow INFO:
	 [Node] Setting-up "workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsmxt_datasink" in "/home/jovyan/example-notebooks/books/structural_imaging/qsm/workflow/sub-2/ses-20170705/qsmxt_acq-qsmp21mmisote20_run-01/qsmxt_datasink".
230828-04:45:54,258 nipype.workflow INFO:
	 [Node] Executing "qsmxt_datasink" <nipype.interfaces.io.DataSink>
230828-04:45:54,260 nipype.workflow INFO:
	 [Node] Finished "qsmxt_datasink", elapsed time 0.001011s.
230828-04:45:56,186 nipype.workflow INFO:
	 [Job 37] Completed (workflow.sub-2.ses-20170705.qsmxt_acq-qsmp21mmisote20_run-01.qsmxt_datasink).
230828-04:45:56,188 nipype.workflow INFO:
	 [MultiProc] Running 0 tasks, and 0 jobs ready. Free memory (GB): 224.31/224.31, Free processors: 16/16.
[INFO]: Finished

View results#

Let’s have a look at the generated qsm folder:

!tree qsm/ -L 1 --dirsfirst
qsm/
├── analysis
├── qsm
├── segmentations
├── workflow
├── command.txt
├── pypeline.log
├── qsmxt.log
├── references.txt
└── settings.json

4 directories, 5 files

The references.txt file contains a list of all the algorithms used and relevant citations:

!cat qsm/references.txt
== References ==

 - QSMxT: Stewart AW, Robinson SD, O'Brien K, et al. QSMxT: Robust masking and artifact reduction for quantitative susceptibility mapping. Magnetic Resonance in Medicine. 2022;87(3):1289-1300. doi:10.1002/mrm.29048

 - QSMxT: Stewart AW, Bollman S, et al. QSMxT/QSMxT. GitHub; 2022. https://github.com/QSMxT/QSMxT

 - Python package - Nipype: Gorgolewski K, Burns C, Madison C, et al. Nipype: A Flexible, Lightweight and Extensible Neuroimaging Data Processing Framework in Python. Frontiers in Neuroinformatics. 2011;5. Accessed April 20, 2022. doi:10.3389/fninf.2011.00013

 - Brain extraction: Smith SM. Fast robust automated brain extraction. Human Brain Mapping. 2002;17(3):143-155. doi:10.1002/hbm.10062

 - Brain extraction: Liangfu Chen. liangfu/bet2 - Standalone Brain Extraction Tool. GitHub; 2015. https://github.com/liangfu/bet2

 - Unwrapping algorithm - ROMEO: Dymerska B, Eckstein K, Bachrata B, et al. Phase unwrapping with a rapid opensource minimum spanning tree algorithm (ROMEO). Magnetic Resonance in Medicine. 2021;85(4):2294-2308. doi:10.1002/mrm.28563

 - Background field removal - V-SHARP: Wu B, Li W, Guidon A et al. Whole brain susceptibility mapping using compressed sensing. Magnetic resonance in medicine. 2012 Jan;67(1):137-47. doi:10.1002/mrm.23000

 - QSM algorithm - RTS: Kames C, Wiggermann V, Rauscher A. Rapid two-step dipole inversion for susceptibility mapping with sparsity priors. Neuroimage. 2018 Feb 15;167:276-83. doi:10.1016/j.neuroimage.2017.11.018

 - Julia package - QSM.jl: kamesy. GitHub; 2022. https://github.com/kamesy/QSM.jl

 - Julia package - MriResearchTools: Eckstein K. korbinian90/MriResearchTools.jl. GitHub; 2022. https://github.com/korbinian90/MriResearchTools.jl

 - Python package - nibabel: Brett M, Markiewicz CJ, Hanke M, et al. nipy/nibabel. GitHub; 2019. https://github.com/nipy/nibabel

 - Python package - scipy: Virtanen P, Gommers R, Oliphant TE, et al. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nat Methods. 2020;17(3):261-272. doi:10.1038/s41592-019-0686-2

 - Python package - numpy: Harris CR, Millman KJ, van der Walt SJ, et al. Array programming with NumPy. Nature. 2020;585(7825):357-362. doi:10.1038/s41586-020-2649-2

 - FastSurfer: Henschel L, Conjeti S, Estrada S, Diers K, Fischl B, Reuter M. FastSurfer - A fast and accurate deep learning based neuroimaging pipeline. NeuroImage. 2020;219:117012. doi:10.1016/j.neuroimage.2020.117012

 - ANTs: Avants BB, Tustison NJ, Johnson HJ. Advanced Normalization Tools. GitHub; 2022. https://github.com/ANTsX/ANTs

Let’s view one of the QSM results:

QSM results#

!tree qsm/qsm -L 1 --dirsfirst
qsm/qsm
├── sub-1_ses-20170705_acq-qsmp21mmisote20_run-01_part-phase_T2starw_scaled_romeo-unwrapped_normalized_vsharp_rts.nii
└── sub-2_ses-20170705_acq-qsmp21mmisote20_run-01_part-phase_T2starw_scaled_romeo-unwrapped_normalized_vsharp_rts.nii

0 directories, 2 files
show_nii(glob("qsm/qsm/*.nii*")[0], cmap='gray', vmin=-0.15, vmax=+0.15, interpolation='nearest')
../_images/2199c8ee345ba20e332497cef76c0a3eb8038646c388db36ab79dd5cd194cf74.png

Segmentations#

Segmentations are generated in both the QSM space and the T1-weighted space. Transformations are also made available.

!tree qsm/segmentations
qsm/segmentations
├── qsm
│   ├── sub-1_ses-20170705_acq-mp2ragehighres0p5isoslab_run-01_T1w_segmentation_nii_trans.nii
│   └── sub-2_ses-20170705_acq-mp2ragehighres0p5isoslab_run-01_T1w_segmentation_nii_trans.nii
├── t1w
│   ├── sub-1_ses-20170705_acq-mp2ragehighres0p5isoslab_run-01_T1w_segmentation_nii.nii
│   └── sub-2_ses-20170705_acq-mp2ragehighres0p5isoslab_run-01_T1w_segmentation_nii.nii
└── transforms
    ├── sub-1_ses-20170705_acq-{acq}_run-01_0GenericAffine.mat
    └── sub-2_ses-20170705_acq-{acq}_run-01_0GenericAffine.mat

3 directories, 6 files
show_nii(glob("qsm/segmentations/qsm/*.nii*")[0], cmap='terrain', vmin=0, vmax=96, interpolation='nearest')
../_images/23cf8a9b34a025f40eddaca23c3d9d769998d95eb2b1bc4bfc3ca83db4942aa6.png

Analysis CSVs#

Here, we can see CSV files have been exported containing susceptibility values in regions of interest for each subject:

!tree qsm/analysis
qsm/analysis
├── sub-1_ses-20170705_acq-qsmp21mmisote20_run-01_part-phase_T2starw_scaled_romeo-unwrapped_normalized_vsharp_rts_csv.csv
└── sub-2_ses-20170705_acq-qsmp21mmisote20_run-01_part-phase_T2starw_scaled_romeo-unwrapped_normalized_vsharp_rts_csv.csv

0 directories, 2 files

Here we will load the CSVs, inspect the data and generate figures:

!pip install seaborn numpy nibabel pandas matplotlib
Requirement already satisfied: seaborn in /opt/conda/lib/python3.10/site-packages (0.12.2)
Requirement already satisfied: numpy in /opt/conda/lib/python3.10/site-packages (1.25.2)
Requirement already satisfied: nibabel in /opt/conda/lib/python3.10/site-packages (4.0.2)
Requirement already satisfied: pandas in /opt/conda/lib/python3.10/site-packages (2.0.3)
Requirement already satisfied: matplotlib in /opt/conda/lib/python3.10/site-packages (3.6.2)
Requirement already satisfied: setuptools in /opt/conda/lib/python3.10/site-packages (from nibabel) (65.6.3)
Requirement already satisfied: packaging>=17.0 in /opt/conda/lib/python3.10/site-packages (from nibabel) (22.0)
Requirement already satisfied: python-dateutil>=2.8.2 in /opt/conda/lib/python3.10/site-packages (from pandas) (2.8.2)
Requirement already satisfied: tzdata>=2022.1 in /opt/conda/lib/python3.10/site-packages (from pandas) (2023.3)
Requirement already satisfied: pytz>=2020.1 in /opt/conda/lib/python3.10/site-packages (from pandas) (2022.7)
Requirement already satisfied: pillow>=6.2.0 in /opt/conda/lib/python3.10/site-packages (from matplotlib) (9.2.0)
Requirement already satisfied: cycler>=0.10 in /opt/conda/lib/python3.10/site-packages (from matplotlib) (0.11.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /opt/conda/lib/python3.10/site-packages (from matplotlib) (1.4.4)
Requirement already satisfied: pyparsing>=2.2.1 in /opt/conda/lib/python3.10/site-packages (from matplotlib) (3.0.9)
Requirement already satisfied: contourpy>=1.0.1 in /opt/conda/lib/python3.10/site-packages (from matplotlib) (1.0.6)
Requirement already satisfied: fonttools>=4.22.0 in /opt/conda/lib/python3.10/site-packages (from matplotlib) (4.38.0)
Requirement already satisfied: six>=1.5 in /opt/conda/lib/python3.10/site-packages (from python-dateutil>=2.8.2->pandas) (1.16.0)
# import modules
import numpy as np
import nibabel as nib
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
from glob import glob

The raw CSV files use names from FreeSurfer as exported by FastSurfer. The full list of regions is available here.

pd.read_csv(glob("qsm/analysis/sub-1*.csv")[0])
roi num_voxels min max median mean std
0 3rd-Ventricle 586 -0.237164 0.125742 -0.019675 -0.023015 0.034695
1 4th-Ventricle 1559 -0.126198 0.031669 -0.049291 -0.051198 0.027234
2 Brain-Stem 18858 -0.281279 0.103408 -0.044077 -0.039981 0.028722
3 CSF 770 -1.398996 0.946292 0.026568 0.027402 0.147044
4 Left-Accumbens-area 521 -0.143444 0.129420 0.028555 0.023690 0.032063
... ... ... ... ... ... ... ...
91 ctx-rh-superiorfrontal 29625 -0.133545 0.252691 -0.004135 -0.009295 0.025207
92 ctx-rh-superiorparietal 12193 -0.084040 0.196441 -0.014620 -0.014232 0.020587
93 ctx-rh-superiortemporal 16220 -0.111554 0.249189 0.006599 0.012811 0.024041
94 ctx-rh-supramarginal 12193 -0.082319 0.240526 0.019189 0.020113 0.022540
95 ctx-rh-transversetemporal 1245 0.000628 0.171856 0.034773 0.035769 0.015936

96 rows × 7 columns

We will select a subset of these ROIs and give them more readable names:

# define regions of interest
# see https://github.com/QSMxT/QSMxT/blob/master/aseg_labels.csv for a full list
rois = { 
    "Thalamus" : [9, 10, 48, 49],
    "Pallidum" : [12, 13, 52, 53],
    "Caudate" : [11, 50],
    "Putamen" : [12, 51],
    "Brain stem" : [16],
    "CSF" : [24, 122, 257, 701],
    "White matter" : [2, 7, 41, 46, 177]
}
roi_names = { value: key for key in rois for value in rois[key] }
roi_ids = [value for roi in rois.values() for value in roi]
# load a reconstruction
qsm = nib.load(glob("qsm/qsm/*.nii*")[0]).get_fdata().flatten()
seg = nib.load(glob("qsm/segmentations/qsm/*.nii*")[0]).get_fdata().flatten()
# retain only the rois
qsm = qsm[np.isin(seg, roi_ids)]
seg = seg[np.isin(seg, roi_ids)]
# convert to a dataframe for plotting purposes
seg = pd.Series(seg).map(roi_names)
data = pd.DataFrame({ 'qsm' : qsm, 'seg' : seg })
# summarise data by region including the average and standard deviation
data.groupby('seg')['qsm'].agg(['mean', 'std']).sort_values('mean').round(decimals=3)
mean std
seg
Brain stem -0.040 0.029
White matter -0.002 0.028
CSF 0.027 0.147
Thalamus 0.030 0.034
Pallidum 0.033 0.060
Putamen 0.047 0.033
Caudate 0.048 0.023
medians = data.groupby('seg')['qsm'].median().sort_values()
order = medians.index
# plot
fig = plt.figure()
ax = sns.boxplot(data, y='qsm', x='seg', fliersize=0, color='lightblue', order=order)
ax.set_xticklabels(ax.get_xticklabels(), ha='right', rotation=45)
ax.set_ylim(-0.2, 0.3)
ax.axhline(y=0, color='pink', linestyle='-', linewidth=1, zorder=-1)
ax.set_xlabel("Region of interest")
ax.set_ylabel("Susceptibility (ppm)")
ax.set_title("QSM")
plt.show()
../_images/1ceaaf189439c23c6314f6a82f24481bc0c268b31a916a329a5f6be8673bb005.png