02 Workflows - LICE-dev/swane GitHub Wiki

SWANe consists in a number of parallel workflows.
Each one of these workflows is enabled if the user loads the relative Series in the Data Load subtab.
Some of these analyses are optional or can be customized. In the following paragraphs this guide specifies which preferences are related to each workflow. The user sets these preferences in the Workflow preferences window.

Warning

Some analyses could take some time, especially on old computers.
In the next paragraphs a rough estimation of the computation time will be given for each analysis.
The estimation is based on an Intel i5 8th Gen. 6-core CPU with 8 GB RAM.

Due to the complexity of configuring analyses preferences and the potential long computation time, SWANe provides two convenient workflow preference presets:

  • The Morpho-Functional preset is intended as an instrument to better characterize the Epileptogenic Zone (EZ) and enables, if possible:
    • hippocampal and amygdala segmentation based on FreeSurfer analysis;
    • FlaT1 analysis;
    • Asymmetry index map for PET and ASL.
  • The Structural preset aims to build up the multimodal 3D scene of all imaging modalities merged in subject individual space. The above time-consuming analyses are disabled, while probabilistic tractography is enabled.

The two presets are not rigidly independent, but each of them might be personalized with additional analyses.

Below a summary chart for each of SWANe analyses.


3D T1w analysis

Generates T13D Nifti files to use as reference.

Estimated analysis time: approx. 5 minutes.

flowchart TD
data("<h3><b>Required Data</b></h3>
3D T1w")
steps("<h3><b>Main Steps</b></h3>
DICOM ⮕ Nifti Conversion
Neck and scalp Removal")
results("<h3><b>Results</b></h3>
<b>ref.nii.gz</b>: T13D Nifti file
<b>ref_brain.nii.gz</b>: skull stripped T13D Nifti file")

data-->steps
steps-->results

style data fill:#AED6F1,stroke:#5499C7,stroke-width:3px,color:black
style steps fill:#ABEBC6,stroke:#2ECC71,stroke-width:3px,color:black
style results fill:#E6B0AA,stroke:#CD6155,stroke-width:3px,color:black
Loading

3D T1w, FreeSurfer and FlaT1 Preferences

  • Bias reduction for skull removal enables the -B argument for BET.
  • Threshold value for skull removal sets the threshold value of -f argument for BET.
  • FreeSurfer analysis enables the FreeSurfer analysis.
  • FreeSurfer hippocampal and amygdala subfields enables the corresponding segmentation into the FreeSurfer analysis.
  • FLAT1 analysis enables the corresponding FlaT1 analysis.

3D T1w


3D Flair analysis

Generates 3D Flair Nifti files and perform linear registration to reference space.

Estimated analysis time: approx. 15 minutes.

flowchart TD
data("<h3><b>Required Data</b></h3>
3D Flair")
analysis("<h3><b>Required Analysis</b></h3>
3D T1w")
steps("<h3><b>Main Steps</b></h3>
DICOM ⮕ Nifti Conversion
Neck and scalp Removal
Linear registration to reference space")
results("<h3><b>Results</b></h3>
<b>r-flair.nii.gz</b>: 3D Flair Nifti file
<b>r-flair_brain.nii.gz</b>: skull stripped 3D Flair Nifti file")

data-->steps
analysis-->steps
steps-->results

style data fill:#AED6F1,stroke:#5499C7,stroke-width:3px,color:black
style analysis fill:#EDBB99,stroke:#DC7633,stroke-width:3px,color:black
style steps fill:#ABEBC6,stroke:#2ECC71,stroke-width:3px,color:black
style results fill:#E6B0AA,stroke:#CD6155,stroke-width:3px,color:black
Loading

3D Flair and Post Contrast 3DT1w Preferences

  • Bias reduction for skull removal enables the -B argument for BET.
  • Threshold value for skull removal sets the threshold value of -f argument for BET.

Workflow - 3D Flair


2D Cor/Sag/Tra Flair analysis

Generates 2D Flair Nifti files and perform linear registration to reference space.

Estimated analysis time: approx. 15 minutes.

flowchart TD
data("<h3><b>Required Data</b></h3>
2D Flair")
analysis("<h3><b>Required Analysis</b></h3>
3D T1w")
preferences("<h3><b>2D Flair Preferences</b></h3>
<b>Coronal</b> OR <b>Sagittal</b> OR <b>Trasverse</b>")
steps("<h3><b>Main Steps</b></h3>
DICOM ⮕ Nifti Conversion
Neck and scalp Removal
Linear registration to reference space")
results("<h3><b>Results</b></h3>
<b>r-flair2d_cor/sag/tra.nii.gz</b>: 2d Flair Nifti file
<b>r-flair2d_cor/sag/tra_brain.nii.gz</b>: skull stripped 2d Flair Nifti file")

data-->steps
analysis-->steps
preferences-->steps
steps-->results

style data fill:#AED6F1,stroke:#5499C7,stroke-width:3px,color:black
style analysis fill:#EDBB99,stroke:#DC7633,stroke-width:3px,color:black
style preferences fill:#D2B4DE,stroke:#8E44AD,stroke-width:3px,color:black
style steps fill:#ABEBC6,stroke:#2ECC71,stroke-width:3px,color:black
style results fill:#E6B0AA,stroke:#CD6155,stroke-width:3px,color:black
Loading

2D Cor T2 analysis

Generates 2D Cor T2 Nifti files and perform linear registration to reference space.

Estimated analysis time: approx. 5 minutes.

flowchart TD
data("<h3><b>Required Data</b></h3>
2D Flair")
analysis("<h3><b>Required Analysis</b></h3>
3D T1w")
preferences("<h3><b>2D T2 Coronal Preferences</b></h3>")
steps("<h3><b>Main Steps</b></h3>
DICOM ⮕ Nifti Conversion
Neck and scalp Removal
Linear registration to reference space")
results("<h3><b>Results</b></h3>
<b>r-t2_cor.nii.gz</b>: 2d Cor T2 Nifti file
<b>r-t2_cor_brain.nii.gz</b>: skull stripped 2d T2 Nifti file")

data-->steps
analysis-->steps
preferences-->steps
steps-->results

style data fill:#AED6F1,stroke:#5499C7,stroke-width:3px,color:black
style analysis fill:#EDBB99,stroke:#DC7633,stroke-width:3px,color:black
style preferences fill:#D2B4DE,stroke:#8E44AD,stroke-width:3px,color:black
style steps fill:#ABEBC6,stroke:#2ECC71,stroke-width:3px,color:black
style results fill:#E6B0AA,stroke:#CD6155,stroke-width:3px,color:black
Loading

Post-contrast 3D T1w analysis

Generates post-contrast 3D T1w NIFTI files and perform linear registration to T13D reference space.

Generate 3D Flair Nifti files and perform linear registration to reference space.

Estimated analysis time: approx. 15 minutes.

flowchart TD
data("<h3><b>Required Data</b></h3>
Post-Contrast 3D T1w")
analysis("<h3><b>Required Analysis</b></h3>
3D T1w")
steps("<h3><b>Main Steps</b></h3>
DICOM ⮕ Nifti Conversion
Neck and scalp Removal
Linear registration to reference space")
results("<h3><b>Results</b></h3>
<b>r-mdc.nii.gz</b>: Post-Contrast 3D T1w Nifti file
<b>r-mdc_brain.nii.gz</b>: skull stripped Post-Contrast 3D T1w Nifti file
")

data-->steps
analysis-->steps
steps-->results

style data fill:#AED6F1,stroke:#5499C7,stroke-width:3px,color:black
style analysis fill:#EDBB99,stroke:#DC7633,stroke-width:3px,color:black
style steps fill:#ABEBC6,stroke:#2ECC71,stroke-width:3px,color:black
style results fill:#E6B0AA,stroke:#CD6155,stroke-width:3px,color:black
Loading

FreeSurfer analysis

Performs FreeSurfer[3] cortical reconstruction and, if enabled, segmentation of the hippocampal substructures and the nuclei of the amygdala.

Estimated analysis time: approx. 10 hours.

flowchart TD
analysis("<h3><b>Required Analysis</b></h3>
3D T1w")
freesurferpreferences("<h3><b>FreeSurfer Analysis Preferences</b></h3>
Enables the FreeSurfer Analysis")
hippocampalpreferences("<h3><b>FreeSurfer Hippocampal Subfield Preferences</b></h3>
Enables the <b>segmentation of the hippocampal</b>
Enables the <b>amygdala substructures</b>")
steps("<h3><b>Main Steps</b></h3>
Recon-all cortical reconstruction process
Linear transformation of cortical segmentation in reference 
space
White matter and basal ganglia/thalami (BGT) extraction
<b>OPTIONAL</b> Hippocampal and amygdala segmentation")
results("<h3><b>Results</b></h3>
<b>rh.pial</b>: right hemisphere pial surface
<b>lh.pial</b>: left hemisphere pial surface
<b>rh.white</b>: right hemisphere white matter surface
<b>lh.white</b>: left hemisphere white matter surface
<b>r-aparc_aseg.mgz</b>: aparc parcellation in T13D reference space
<b>rh.hippoAmygLabels.mgz</b>: right side labels from 
segmentation of the hippocampal and amygdala substructures
<b>lh.hippoAmygLabels.mgz</b>: left side labels from segmentation 
of the hippocampal and amygdala substructures")

analysis-->steps
freesurferpreferences-->steps
hippocampalpreferences-->steps
steps-->results

style analysis fill:#EDBB99,stroke:#DC7633,stroke-width:3px,color:black
style freesurferpreferences fill:#D2B4DE,stroke:#8E44AD,stroke-width:3px,color:black
style hippocampalpreferences fill:#D2B4DE,stroke:#8E44AD,stroke-width:3px,color:black
style steps fill:#ABEBC6,stroke:#2ECC71,stroke-width:3px,color:black
style results fill:#E6B0AA,stroke:#CD6155,stroke-width:3px,color:black
Loading

FlaT1 analysis

Creates a junction[5,6] and extension[7] z-score map based on 3D T1w, 3D Flair and a mean template.

Estimated analysis time: approx. 1 hour.

flowchart TD
analysis("<h3><b>Required Analysis</b></h3>
3D T1w
3D Flair")
steps("<h3><b>Main Steps</b></h3>
Nonlinear registration to MNI atlas
Segmentation of white matter, grey matter, CFS
Flair/T1 normalization (binary flair)
Outliers and cerebellum removal
External percentiles removal for gray white matter and gray 
matter distribution
Junction and z-score map calculation
Brain/cerebellum grey matter normalization
Extension and z-score map calculation")
results("<h3><b>Results</b></h3>
<b>r-extension_z.nii.gz</b>: extension z-score map in reference space
<b>r-junction_z.nii.gz</b>: junction z-score map in reference space
<b>r-binary_flair.nii.gz</b>: binary flair in reference space")

analysis-->steps
steps-->results

style analysis fill:#EDBB99,stroke:#DC7633,stroke-width:3px,color:black
style steps fill:#ABEBC6,stroke:#2ECC71,stroke-width:3px,color:black
style results fill:#E6B0AA,stroke:#CD6155,stroke-width:3px,color:black
Loading

PET & Arterial Spin Labeling (ASL) analysis

Analysis for:

  • Registration to reference;
  • Z-score and asymmetry index maps;
  • Projection on FreeSurfer pial surface.

Estimated analysis time: approx. 10 hours.

flowchart TD
data("<h3><b>Required Data</b></h3>
PET or ASL")
analysis("<h3><b>Required Analysis</b></h3>
3D T1w
<b>OPTIONAL</b> FreeSurfer")
preferences("<h3><b>Asymmetry Index Map for ASL & PET Preferences</b></h3>
Enables the asymmetry index calculation")
steps("<h3><b>Main Steps</b></h3>
DICOM ⮕ Nifti Conversion
Brain mask for Scalp removal
Linear registration to reference space
Smoothing

<h4><b>With Asymmetry Index preference enabled</b></h4>
Nonlinear registration to symmetric atlas
Asymmetry index calculation

<h4><b>With FreeSurfer analysis avaiable</b></h4>
Intensity normalization compared to basal ganglia Maps projection on RH/LH pial surface")
results("<h3><b>Results</b></h3>
<b>r-pet/asl.nii.gz</b>: functional map in reference space

<h4><b>With Asymmetry Index</b></h4>
<b>r-pet/asl_ai.nii.gz</b>: asymmetry index in reference space
<b>pet/asl_ai_surf_rh/lh.mgz</b>: asymmetry index projection on RH/LH pial surface

<h4><b>With FreeSurfer</b></h4>
<b>r-pet/asl_zscore.nii.gz</b>: z-score statistics compared to BGT
<b>pet/asl_surf_rh/lh.mgz</b>: map projection on RH/LH pial 
surface
<b>pet/asl_zscore_surf_rh/lh.mgz</b>: z-score map projection on 
RH/LH pial surface")

data-->steps
analysis-->steps
preferences-->steps
steps-->results

style data fill:#AED6F1,stroke:#5499C7,stroke-width:3px,color:black
style analysis fill:#EDBB99,stroke:#DC7633,stroke-width:3px,color:black
style preferences fill:#D2B4DE,stroke:#8E44AD,stroke-width:3px,color:black
style steps fill:#ABEBC6,stroke:#2ECC71,stroke-width:3px,color:black
style results fill:#E6B0AA,stroke:#CD6155,stroke-width:3px,color:black
Loading

PET and ASL Preferences

  • Asymmetry Index map for ASL/PET enables the asymmetry index calculation for the analyses (requires time-consuming non-linear registration with a symmetric atlas).
  • Threshold for Asymmetry Index map outliers removal sets the threshold value to detect and discard the outliers.

Workflow - ASL


Diffusion Tensor Imaging preprocessing

DTI preprocessing workflow and fractional anisotropy calculation.

Estimated analysis time: approx. 5 hours.

flowchart TD
data("<h3><b>Required Data</b></h3>
Diffusion Tensor Imaging")
analysis("<h3><b>Required Analysis</b></h3>
3D T1w")
preferences("<h3><b>DTI Tractrography Preferences</b></h3>
Enables the Bayesian estimation of diffusion parameters")
steps("<h3><b>Main Steps</b></h3>
DICOM ⮕ Nifti Conversion
B0 extraction
Scalp removal
Linear registration to reference space
Eddy current and motion artifacts correction
DTI metrics calculation
<b>OPTIONAL</b> Bayesian estimation of diffusion parameters")
results("<h3><b>Results</b></h3>
<b>r-FA.nii.gz</b>: fractional anisotropy map in reference space")

data-->steps
analysis-->steps
preferences-->steps
steps-->results

style data fill:#AED6F1,stroke:#5499C7,stroke-width:3px,color:black
style analysis fill:#EDBB99,stroke:#DC7633,stroke-width:3px,color:black
style preferences fill:#D2B4DE,stroke:#8E44AD,stroke-width:3px,color:black
style steps fill:#ABEBC6,stroke:#2ECC71,stroke-width:3px,color:black
style results fill:#E6B0AA,stroke:#CD6155,stroke-width:3px,color:black
Loading

DTI and Tractography Preferences

  • Use older but faster fsl eddy_correct enables the use of the deprecated tool eddy_correct instead of the newer eddy tool, which is slower but more accurate and supports parallelization and GPU computation.
  • DTI tractography enables time-consuming Tractography analysis (the user should enable each tract of interest from the options below).
  • Parallel processes for each side tractography splits each tract reconstruction into a number of processes (this option is ignored if CUDA is enabled).

Workflow - DTI


Tractography

Tractography execution for chosen tract using FSL xtract protocols.

Estimated analysis time: approx. 1 hour.

flowchart TD
analysis("<h3><b>Required Analysis</b></h3>
3D T1w
DTI Preprocessing")
dtipreferences("<h3><b>DTI Tractography Preferences</b></h3>
Enables the Bayesian estimation of diffusion parameters")
tractographypreferences("<h3><b>Tractography Settings Preferences</b></h3>
Enables specific tract reconstractions")
steps("<h3><b>Main Steps</b></h3>
Nonlinear registration to xtract protocol atlas space
Nonlinear transformation of protocol ROIs in reference space
Parallelized tractography with random seeds
<b>IF REQUIRED BY PROTOCOL</b> Inverted parallelized tractography
Sum of tractographies results")
results("<h3><b>Results</b></h3>
<b>r-rh/lh_tractname.nii.gz</b>: RH/LH connectivity distribution in reference space
<b>r-rh/lh_tractname_waytotal</b>: text file containing a single number corresponding to the total number of generated tracts not rejected by inclusion/exclusion mask criteria for RH/LH side")

analysis-->steps
dtipreferences-->steps
tractographypreferences-->steps
steps-->results

style analysis fill:#EDBB99,stroke:#DC7633,stroke-width:3px,color:black
style dtipreferences fill:#D2B4DE,stroke:#8E44AD,stroke-width:3px,color:black
style tractographypreferences fill:#D2B4DE,stroke:#8E44AD,stroke-width:3px,color:black
style steps fill:#ABEBC6,stroke:#2ECC71,stroke-width:3px,color:black
style results fill:#E6B0AA,stroke:#CD6155,stroke-width:3px,color:black
Loading

Task fMRI analysis

fMRI first level analysis for a single or double task with constant task-rest paradigm.

Up to three different fMRI runs can be loaded and analyzed with different parameters.

Estimated analysis time: approx. 30 minutes.

flowchart TD
data("<h3><b>Required Data</b></h3>
Task fMRI 0/1/2")
analysis("<h3><b>Required Analysis</b></h3>
3D T1w")
preferences("<h3><b>fMRI 0/1/2 Preferences</b></h3>
Set the fMRI anlysis preferences for each loaded run
<b>Task names</b>: names of the tasks
<b>Task duration</b>: duration in seconds of the tasks (only paradigm with constant duration of both tasks is supported)
<b>Rest duration</b>: duration in seconds of the rest periods (only paradigm with constant duration of both tasks is supported)
<b>TR</b>: times of repetition in seconds (if set to auto the preference will be auto detected)
<b>Number of EPI runs</b>: EPI runs contained in current sequence (if set to auto the preference will be auto detected)
<b>Block design</b>: one between rArA (rest-taskA-rest-taskA) and rArBrArB (rest-taskA-rest-taskB-rest-taskA-resttaskB). If rArA is selected, Task B will be ignored
<b>Slice timing</b>: one among <b>Unknown</b> (correction disabled), <b>Regular Up, Regular Down, Interleaved</b> for slice timing correction
<b>Delete start/end volumes</b>: volumes to discard from start and end of the sequence")
steps("<h3><b>Main Steps</b></h3>
DICOM ⮕ Nifti Conversion
Reference volume selection
Scalp removal
Linear registration to reference space
Start/End volumes removal
Smoothing
Image correction (motion and slice timing correction, outlier removal, denoising)
Intensity normalization
Highpass temporal filtering
Design specific file generation
General linear model estimation
Cluster extraction")
results("<h3><b>Results</b></h3>
<h4><b>For rArA design</b></h4>
<b>r-fMRI_%_cluster_t%_TaskA_versus_Rest.nii.gz</b>: cluster of activation (task vs rest) in reference space for different threshold (3.1, 5.1, 7.1)

<h4><b>For rArBrArB design</b></h4>
<b>r-fMRI_%_cluster_t%_TaskA_versus_TaskB.nii.gz</b>: cluster of activation (task A vs task B) in reference space for different threshold (3.1, 5.1, 7.1)
<b>r-fMRI_%_cluster_t%_TaskB_versus_TaskA.nii.gz</b>: cluster of activation (task B vs task A) in reference space for different threshold (3.1, 5.1, 7.1)")

data-->steps
analysis-->steps
preferences-->steps
steps-->results

style data fill:#AED6F1,stroke:#5499C7,stroke-width:3px,color:black
style analysis fill:#EDBB99,stroke:#DC7633,stroke-width:3px,color:black
style preferences fill:#D2B4DE,stroke:#8E44AD,stroke-width:3px,color:black
style steps fill:#ABEBC6,stroke:#2ECC71,stroke-width:3px,color:black
style results fill:#E6B0AA,stroke:#CD6155,stroke-width:3px,color:black
Loading

Task fMRI Preferences

  • Task names sets a label for the Task A and B (Task B requires rArB block design).
  • Block design sets the event design between rArA (rest-taskA-rest-taskA...) and rArBrArB (rest-taskA-rest-taskB...).

Important

All events and rests must have a constant duration.

  • Tasks duration (sec) sets the duration of all task events.
  • Rest duration (sec) sets the duration of all rests (can be set to 0 if the design does not include rest between taskA and taskB).
  • Repetition Time (TR) is the "Time of Repetition" of the BOLD sequence in seconds (can be set to -1 for automatic detection).
  • Number of volumes is the BOLD sequence volume number (can be set to -1 for automatic detection).
  • Slice timing is the slice order acquisition, if known.
  • Delete start volumes specifies the number of volumes to be deleted at the beginning of the BOLD sequence.
  • Delete end volumes specifies the number of volumes to be deleted at the end of the BOLD sequence.

Workflow - Task fMRI


Venous MRA analysis

Analysis of phase contrasts images (in single or two series) to obtain in-skull veins in reference space.

Estimated analysis time: approx. 15 minutes.

flowchart TD
data("<h3><b>Required Data</b></h3>
Venous MRA")
analysis("<h3><b>Required Analysis</b></h3>
3D T1w")
steps("<h3><b>Main Steps</b></h3>
DICOM ⮕ Nifti Conversion
Scalp removal and skull mask application
Linear registration to reference space
Angiographic phase detection
Intensity values scaling in 0-100 range")
results("<h3><b>Results</b></h3>
<b>r-veins-inskull.nii.gz</b>: intracranial veins in reference space")

data-->steps
analysis-->steps
steps-->results

style data fill:#AED6F1,stroke:#5499C7,stroke-width:3px,color:black
style analysis fill:#EDBB99,stroke:#DC7633,stroke-width:3px,color:black
style steps fill:#ABEBC6,stroke:#2ECC71,stroke-width:3px,color:black
style results fill:#E6B0AA,stroke:#CD6155,stroke-width:3px,color:black
Loading

Venous Preferences

  • Threshold value for skull removal sets the threshold value of -f argument for BET.
  • Venous volume detection mode specifies how SWANe tries to identify the venous volume (i.e.: magnitude images) of the phase contrast sequence.

Workflow - Venous

⚠️ **GitHub.com Fallback** ⚠️