DTI-ALPS Primarily Reflects White Matter Diffusion Dispersion and Microstructural Heterogeneity in Neurodegeneration: Insights From Multi-Modal MRI.
The 3 matches
- [1] § Materials and Methods › T1 and FLAIR Images Preprocessing and T1/FLAIR Ratio Calculation ↔ KUL_T1T2FLAIRMTR_ratio.sh, lines 220 to 276 · score 0.75 · N4 bias field, antsRegistration, rigidly, intensity · Report a mismatch
- [2] § Materials and Methods › T1 and FLAIR Images Preprocessing and T1/FLAIR Ratio Calculation ↔ KUL_lesion_fs_recall.sh, lines 684 to 730 · score 0.60 · N4 bias field, ANTs, FLAIR, Preprocessing · Report a mismatch
- [3] § Materials and Methods › T1 and FLAIR Images Preprocessing and T1/FLAIR Ratio Calculation ↔ KUL_T1T2FLAIRMTR_ratio.sh, lines 872 to 928 · score 0.56 · brain masks, calibration, nonlin3, nonlinearly, histogram, template · Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Shell · 998 lines · 44 KB · MPL-2.0 · 2 matches
- #!/bin/bash
- # Sarah Cappelle & Stefan Sunaert
- # 22/12/2020 - v1.0
- # 18/02/2021 - v1.1 (adding calibration)
- # 24/10/2022 - v1.2 (accepted for publication)
- # 17/08/2023 - v1.3 bug fix (using local path)
- #
- # This script computes a T1/T2, T1/FLAIR and MTC (magnetisation transfer contrast) ratio
- #
- # This scripts follows the rationales of
- # - D. Pareto et al. AJNR 2020
- # - Ganzetti et al. Frontiers in human neuroscience 2014
- #
- # Starting from 3D-T1w, 3D-FLAIR and 2D-T2w scans we compute:
- # bias correct the images using N4biascorrect from ANTs
- # ANTs rigid coregister and reslice all images to the 3D-T1w (in isotropic 1 mm space)
- # create masked brain images using HD-BET
- # calibrate the images according to Ganzetti
- # compute a T1FLAIR_ratio, a T1T2_ratio and a MTR
- version="1.3"
- kul_main_dir=$(dirname "$0")
- script=$(basename "$0")
- source $kul_main_dir/KUL_main_functions.sh
- # $cwd & $log_dir is made in main_functions
- # FUNCTIONS --------------
- # function Usage
- function Usage {
- cat <<USAGE
- `basename $0` computes a T1/T2, T1/FLAIR and MTC (magnetisation transfer contrast) ratio, using BIDS organised data.
- Usage:
- `basename $0` <OPT_ARGS>
- Example:
- `basename $0` -p JohnDoe -f 2 -m -v
- Required arguments:
- -p: participant name
- Optional arguments:
- -s: session of the participant
- -a: automatic mode (just work on all images in the BIDS folder)
- -n: number of cpu to use (default 15)
- -m: also run MS lesion segmentation using Freesurfer7 SamSeg
- -f: also run fastsurfer (1=full, 2=segmentation with CC & stats, 3=fast segmentation without CC)
- -d: only perform part of the workflow
- levels:
- 1 = bias-correction
- 2 = rigid registration of the T2w and/or FLAIR to the T1w
- 3 = spatially normalise (warp) the T1w to the MNI atlas
- 4 = run fastsufer (req option -f)
- 5 = run samseg (req option -m)
- 6 = hd-bet the images
- 7 = calibration
- 8 = compute the T1w/T2w and/or T1w/FLAIR ratio
- 9 = compute the MTR
- 10 = warp the results to MNI
- -c: do not run, but output files for the VSC HPC
- -v: show output from commands
- Documentation:
- This script computes a T1/T2, T1/FLAIR and MTC (magnetisation transfer contrast) ratio, using BIDS organised data.
- It follows the rationale of Ganzetti et al. Frontiers in human neuroscience 2014 and D. Pareto et al. AJNR 2020.
- The full methodology is described in "T1w/FLAIR ratio standardization as a myelin marker in MS patients,
- by S Cappelle, D Pareto, S Sunaert, I Smets, A Laenen, B Dubois, Ph Demaerel" - https://pubmed.ncbi.nlm.nih.gov/36451354/
- A T1w is mandatory.
- A T1w/T2w ratio is computed if a T2w is present.
- A T1w/FLAIR ratio is computed if a FLAIR is present.
- A MTR is computed if an MTI pair is available.
- It also segments (MS or T1w-hypo/FLAIR-hyper) lesions using Freesurfer Samseg if T1w and FLAIR are present and option -m is given.
- It also calculates a FastSurfer parcellation if option -f is used.
- Dependecies:
- general:
- - input images must be supplied in Brain Imaging Data Structure (https://bids.neuroimaging.io/) format in the folder "BIDS"
- required:
- - MRTrix3 - https://www.mrtrix.org/
- - ANTs - http://stnava.github.io/ANTs/
- - HD-BET - https://github.com/MIC-DKFZ/HD-BET
- optional:
- - FastSurfer - https://deep-mi.org/research/fastsurfer/
- - Freesurfer Samseg - https://surfer.nmr.mgh.harvard.edu/fswiki/Samseg
- References:
- @ Sarah Cappelle & Stefan Sunaert
- USAGE
- exit 1
- }
- # CHECK COMMAND LINE OPTIONS -------------
- #
- # Set defaults
- auto=0 # default if option -s is not given
- silent=1 # default if option -v is not given
- outputdir="$cwd/T1T2FLAIRMTR_ratio"
- ms=0
- ncpu=15
- fastsurf=0
- hpc=0
- deel=10
- # Set required options
- #p_flag=0
- if [ "$#" -lt 1 ]; then
- Usage >&2
- exit 1
- else
- while getopts "p:s:f:n:d:acmv" OPT; do
- case $OPT in
- a) #automatic mode
- auto=1
- ;;
- p) #participant
- participant=$OPTARG
- ;;
- s) #session
- session=$OPTARG
- ;;
- n) #ncpu
- ncpu=$OPTARG
- ;;
- f) #fastsurfer
- fastsurf=$OPTARG
- ;;
- d) #new workflow
- deel=$OPTARG
- ;;
- m) #MS lesion segmentation
- ms=1
- ;;
- c) #VSC HPC
- hpc=1
- ;;
- v) #verbose
- silent=0
- ;;
- \?)
- echo "Invalid option: -$OPTARG" >&2
- echo
- Usage >&2
- exit 1
- ;;
- :)
- echo "Option -$OPTARG requires an argument." >&2
- echo
- Usage >&2
- exit 1
- ;;
- esac
- done
- fi
- # check for required options
- #if [ $p_flag -eq 0 ] ; then
- # echo
- # echo "Option -p is required: give the BIDS name of the participant." >&2
- # echo
- # exit 2
- #fi
- export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=${ncpu}
- ants_verbose=1
- fs_silent=""
- # verbose or not?
- if [ $silent -eq 1 ] ; then
- export MRTRIX_QUIET=1
- ants_verbose=0
- fs_silent=" > /dev/null 2>&1"
- fi
- d=$(date "+%Y-%m-%d_%H-%M-%S")
- log=log/log_${d}.txt
- # --- FUNCTIONS ---
- function KUL_antsApply_Transform {
- antsApplyTransforms -d 3 \
- --verbose $ants_verbose \
- -i $input \
- -o $output \
- -r $reference \
- -t $transform \
- -n Linear
- }
- function KUL_antsApply_Transform_MNI {
- antsApplyTransforms -d 3 \
- --verbose $ants_verbose \
- -i $input \
- -o $output \
- -r $reference \
- -t $transform1 -t $transform2 \
- -n $interpolation_type
- }
- function KUL_iso_biascorrect {
- local input=$1
- local output
- output=${input##*/}
- output=${output%%.*}
- bias_output=$outdir/tmp/${output}_iso_biascorrected.nii.gz
- if [ ! -f $bias_output ]; then
- echo " doing biascorrection on the ${td}"
- mrgrid $input regrid -voxel 1 $outdir/tmp/${output}_iso.nii.gz -force
- local bias_input=$outdir/tmp/${output}_iso.nii.gz
- N4BiasFieldCorrection --verbose $ants_verbose \
- -d 3 \
- -i $bias_input \
- -o $bias_output
- else
- echo " biascorrection of the ${td} already done"
- fi
- }
- function KUL_MTI_reorient_crop_hdbet_iso {
- iso_output=$outdir/tmp/${output}_iso.nii.gz
- mrgrid $input regrid -voxel 1 $iso_output -force
- }
- # Rigidly register the input to the T1w
- function KUL_rigid_register {
- antsRegistration --verbose $ants_verbose --dimensionality 3 \
- --output [$outdir/tmp/${ants_type},$outdir/tmp/${newname}] \
- --interpolation BSpline \
- --use-histogram-matching 0 --winsorize-image-intensities [0.005,0.995] \
- --initial-moving-transform [$outdir/tmp/$ants_template,$outdir/tmp/$ants_source,1] \
- --transform Rigid[0.1] \
- --metric MI[$outdir/tmp/$ants_template,$outdir/tmp/$ants_source,1,32,Regular,0.25] \
- --convergence [1000x500x250x100,1e-6,10] \
- --shrink-factors 8x4x2x1 --smoothing-sigmas 3x2x1x0vox
- }
- # Register and compute the ratio
- function KUL_reg2t1 {
- local base0=${test_T1w##*/}
- local base=${base0%_T1w*}
- ants_type="${base}_rigid_${td}_reg2t1_"
- ants_template="${base}_T1w_iso_biascorrected.nii.gz"
- ants_source="${base}_${td}_iso_biascorrected.nii.gz"
- newname="${base}_${td}_iso_biascorrected_reg2T1w.nii.gz"
- #finalname="${base}_${td}_reg2T1w.nii.gz"
- if [ ! -f $outdir/tmp/${newname} ]; then
- echo " rigid registration of the ${td} to the T1w"
- KUL_rigid_register
- else
- echo " skipping rigid registration of the ${td} to the T1w - already done"
- fi
- }
- function KUL_computeratio {
- if [ ! -f $outdir/${base}_ratio-T1${td}_calib-nonlin3.nii.gz ];then
- echo " computing the ratio T1w/${td}"
- #if [[ ${td} == "T2w" ]];then
- # factor=42
- #else
- # factor=1.705
- #fi
- #mrcalc \
- # $outdir/tmp/${base}_T1w_iso_biascorrected.nii.gz $factor -div \
- # $outdir/tmp/${base}_${td}_iso_biascorrected_reg2T1w.nii.gz -divide \
- # $outdir/masks/${base}_T1w_iso_biascorrected_brain_mask.nii.gz -multiply \
- # $outdir/${base}_ratio-T1${td}_calib-none.nii.gz -nthreads $ncpu -force
- mrcalc \
- $outdir/tmp/${base}_T1w_iso_biascorrected.nii.gz \
- $outdir/tmp/${base}_${td}_iso_biascorrected_reg2T1w.nii.gz -divide \
- $outdir/masks/${base}_T1w_iso_biascorrected_brain_mask.nii.gz -multiply \
- $outdir/${base}_ratio-T1${td}_calib-none.nii.gz -nthreads $ncpu -force
- mrcalc \
- $outdir/tmp/${base}_T1w_iso_biascorrected_calib-lin.nii.gz \
- $outdir/tmp/${base}_${td}_iso_biascorrected_calib-lin_reg2T1w.nii.gz -divide \
- $outdir/masks/${base}_T1w_iso_biascorrected_brain_mask.nii.gz -multiply \
- $outdir/${base}_ratio-T1${td}_calib-lin.nii.gz -nthreads $ncpu -force
- mrcalc \
- $outdir/tmp/${base}_T1w_iso_biascorrected_calib-nonlin.nii.gz \
- $outdir/tmp/${base}_${td}_iso_biascorrected_calib-nonlin_reg2T1w.nii.gz -divide \
- $outdir/masks/${base}_T1w_iso_biascorrected_brain_mask.nii.gz -multiply \
- $outdir/${base}_ratio-T1${td}_calib-nonlin.nii.gz -nthreads $ncpu -force
- if [ $t2 -eq 1 ]; then #need the T2w to calculate the ventricles
- mrcalc \
- $outdir/tmp/${base}_T1w_iso_biascorrected_calib-nonlin2.nii.gz \
- $outdir/tmp/${base}_${td}_iso_biascorrected_calib-nonlin2_reg2T1w.nii.gz -divide \
- $outdir/masks/${base}_T1w_iso_biascorrected_brain_mask.nii.gz -multiply \
- $outdir/${base}_ratio-T1${td}_calib-nonlin2.nii.gz -nthreads $ncpu -force
- fi
- mrcalc \
- $outdir/tmp/${base}_T1w_iso_biascorrected_calib-nonlin3.nii.gz \
- $outdir/tmp/${base}_${td}_iso_biascorrected_calib-nonlin3_reg2T1w.nii.gz -divide \
- $outdir/masks/${base}_T1w_iso_biascorrected_brain_mask.nii.gz -multiply \
- $outdir/${base}_ratio-T1${td}_calib-nonlin3.nii.gz -nthreads $ncpu -force
- else
- echo " the ratio T1w/${td} is already computed"
- fi
- }
- function KUL_apply_warp2mni {
- echo " warping ${td} results to MNI"
- reference=$fix_im
- transform1="$outdir/warp2mni/${base}_T1w2MNI_1Warp.nii.gz"
- transform2="[$outdir/warp2mni/${base}_T1w2MNI_0GenericAffine.mat,0]"
- interpolation_type="LanczosWindowedSinc"
- if [[ ${td} == "T1w" ]];then
- local ext=""
- elif [[ ! ${td} == "MTI" ]];then
- local ext="_reg2T1w"
- input="$outdir/${base}_ratio-T1${td}_calib-none.nii.gz"
- output="$outdir/${base}_space-MNI_ratio-T1${td}_calib-none.nii.gz"
- KUL_antsApply_Transform_MNI
- input="$outdir/${base}_ratio-T1${td}_calib-lin.nii.gz"
- output="$outdir/${base}_space-MNI_ratio-T1${td}_calib-lin.nii.gz"
- KUL_antsApply_Transform_MNI
- input="$outdir/${base}_ratio-T1${td}_calib-nonlin.nii.gz"
- output="$outdir/${base}_space-MNI_ratio-T1${td}_calib-nonlin.nii.gz"
- KUL_antsApply_Transform_MNI
- if [ $t2 -eq 1 ]; then
- input="$outdir/${base}_ratio-T1${td}_calib-nonlin2.nii.gz"
- output="$outdir/${base}_space-MNI_ratio-T1${td}_calib-nonlin2.nii.gz"
- KUL_antsApply_Transform_MNI
- fi
- input="$outdir/${base}_ratio-T1${td}_calib-nonlin3.nii.gz"
- output="$outdir/${base}_space-MNI_ratio-T1${td}_calib-nonlin3.nii.gz"
- KUL_antsApply_Transform_MNI
- elif [[ ${td} == "MTI" ]];then
- local ext="_reg2T1w"
- input="$outdir/${base}_ratio-MTC.nii.gz"
- output="$outdir/${base}_space-MNI_ratio-MTC.nii.gz"
- KUL_antsApply_Transform_MNI
- fi
- input="$outdir/${base}_${td}${ext}.nii.gz"
- output="$outdir/${base}_space-MNI_${td}${ext}.nii.gz"
- KUL_antsApply_Transform_MNI
- }
- function KUL_MTI_register_computeratio {
- base0=${test_T1w##*/}
- base=${base0%_T1w*}
- # convert the 4D MTI to single 3Ds
- input="$outdir/tmp/${base}_${td}_iso.nii.gz"
- S0="$outdir/tmp/${base}_${td}_iso_S0.nii.gz"
- Smt="$outdir/tmp/${base}_${td}_iso_Smt.nii.gz"
- mrconvert $input -coord 3 0 $S0 -force
- mrconvert $input -coord 3 1 $Smt -force
- # determine the registration
- ants_type="${base}_rigid_${td}_reg2t1_"
- ants_template="${base}_T1w_iso_biascorrected.nii.gz"
- ants_source="${base}_${td}_iso_Smt.nii.gz"
- newname="${base}_${td}_iso_Smt_reg2T1w.nii.gz"
- finalname="${base}_${td}_reg2T1w.nii.gz"
- KUL_rigid_register
- Smt="$outdir/tmp/$newname"
- # Now apply the coregistration to the 4D MTI
- input=$S0
- output="$outdir/tmp/${base}_${td}_iso_S0_reg2T1w.nii.gz"
- S0=$output
- transform="$outdir/tmp/${base}_rigid_${td}_reg2t1_0GenericAffine.mat"
- reference="$outdir/tmp/${base}_T1w_iso_biascorrected.nii.gz"
- KUL_antsApply_Transform
- # make a better mask
- mask=$outdir/masks/${base}_T1w_iso_biascorrected_brain_mask.nii.gz
- # MTR formula: (S0 - Smt)/S0
- mrcalc $S0 $Smt -subtract $S0 -divide $mask -multiply \
- $outdir/${base}_ratio-MTC.nii.gz -nthreads $ncpu -force
- # Also warp to MNI space
- reference=$ref_im
- transform1="$outdir/warp2mni/${base}_T1w2MNI_1Warp.nii.gz"
- transform2="[$outdir/warp2mni/${base}_T1w2MNI_0GenericAffine.mat,0]"
- interpolation_type="Linear"
- input="$outdir/${base}_ratio-MTC.nii.gz"
- output="$outdir/${base}_ratio-MTC_MNI.nii.gz"
- KUL_antsApply_Transform_MNI
- cp $outdir/tmp/$newname $outdir/$finalname
- }
- # --- MAIN ---
- printf "\n\n\n"
- # here we give the data
- if [ $auto -eq 0 ]; then
- if [ -z "$session" ]; then
- fullsession1=""
- fullsession2=""
- else
- fullsession1="ses-${session}/"
- fullsession2="ses-${session}_"
- fi
- datadir="$cwd/BIDS/sub-${participant}/${fullsession1}anat"
- T1w=("$datadir/sub-${participant}_${fullsession2}T1w.nii.gz")
- T2w=("$datadir/sub-${participant}_${fullsession2}T2w.nii.gz")
- FLAIR=("$datadir/sub-${participant}_${fullsession2}FLAIR.nii.gz")
- MTI=("$datadir/sub-${participant}_${fullsession2}MTI.nii.gz")
- else
- T1w=($(find $cwd/BIDS -type f -name "*T1w.nii.gz" | sort ))
- fi
- hpc_counter=0
- hpc_task=1
- for test_T1w in ${T1w[@]}; do
- # defining the basename from the array elements
- base0=${test_T1w##*/};base=${base0%_T1w*}
- local_participant=${base%_ses*}
- local_session="ses-${base##*ses-}"
- outdir=$outputdir/$local_participant/$local_session
- check_done="$outdir/${base}.done"
- # resetting found files
- d=0
- t2=0
- flair=0
- mti=0
- # read the level of completed workflow
- if [ ! -f $check_done ];then
- level_done=0
- else
- level_done=$(cat $check_done)
- if [ -z $level_done ];then
- #echo "empty"
- level_done=10
- fi
- fi
- # only execute if workflow level in not yet reached
- if [ $level_done -lt $deel ];then
- echo " current level of processing done: $level_done"
- # write files for the VSC
- if [ $hpc -eq 1 ];then
- mkdir -p VSC
- if [ $hpc_counter -eq 0 ];then
- #echo "#!/bin/bash -e" > VSC/VSC_commands.sh
- echo "participant, session" > VSC/pbs_data_${hpc_task}.csv
- fi
- vsc_participant=${local_participant##*sub-}
- vsc_session=${local_session##*ses-}
- #vsc_cmd="KUL_T1T2FLAIRMTR_ratio_new.sh -p $vsc_participant -s $vsc_session -m -f 2 -d 3"
- #echo $vsc_cmd >> VSC/VSC_commands.sh
- echo "${vsc_participant},${vsc_session}" >> VSC/pbs_data_${hpc_task}.csv
- hpc_counter=$((hpc_counter+1))
- if [ $hpc_counter -ge 34 ];then
- hpc_task=$((hpc_task+1))
- hpc_counter=0
- fi
- else
- # Test whether T2 and/or FLAIR also exist
- test_T2w="${test_T1w%_T1w*}_T2w.nii.gz"
- if [ -f $test_T2w ];then
- #echo "The T2 exists"
- d=$((d+1))
- t2=1
- fi
- test_FLAIR="${test_T1w%_T1w*}_FLAIR.nii.gz"
- if [ -f $test_FLAIR ];then
- #echo "The FLAIR exists"
- d=$((d+1))
- flair=1
- fi
- test_MTI="${test_T1w%_T1w*}_MTI.nii.gz"
- if [ -f $test_MTI ];then
- #echo "The MTI exists"
- d=$((d+1))
- mti=1
- fi
- # If a T1w and a T2w and/or a FLAIR exists
- if [ $d -gt 0 ]; then
- mkdir -p $outdir/tmp
- mkdir -p $outdir/histograms
- mkdir -p $outdir/masks
- mkdir -p $outdir/rois
- mkdir -p $outputdir/log
- kul_e2cl "KUL_T1T2FLAIR_ratio is processing $local_participant and session $local_session" ${outputdir}/${log}
- # PART 1 - make all images conform and bias-correct
- if [ $deel -ge 1 ]; then
- # for the T1w
- td="T1w"
- KUL_iso_biascorrect $test_T1w
- cp $outdir/tmp/${base}_T1w_iso_biascorrected.nii.gz $outdir/${base}_T1w.nii.gz
- if [ $t2 -eq 1 ];then
- td="T2w"
- KUL_iso_biascorrect $test_T2w
- fi
- if [ $flair -eq 1 ];then
- td="FLAIR"
- KUL_iso_biascorrect $test_FLAIR
- fi
- fi
- # PART 2 - register the T2w and/or FLAIR to the T1w
- if [ $deel -ge 2 ]; then
- if [ $t2 -eq 1 ];then
- td="T2w"
- KUL_reg2t1
- cp $outdir/tmp/${base}_${td}_iso_biascorrected_reg2T1w.nii.gz $outdir/${base}_${td}_reg2T1w.nii.gz
- fi
- if [ $flair -eq 1 ];then
- td="FLAIR"
- KUL_reg2t1
- cp $outdir/tmp/${base}_${td}_iso_biascorrected_reg2T1w.nii.gz $outdir/${base}_${td}_reg2T1w.nii.gz
- fi
- fi
- # PART 3 - Spatially normalise (warp) the T1w to the MNI atlas
- if [ $deel -ge 3 ]; then
- fix_im="$kul_main_dir/atlasses/Ganzetti2014/mni_icbm152_t1_tal_nlin_sym_09a.nii"
- ref_im="$kul_main_dir/atlasses/Ganzetti2014/mni_icbm152_t1_tal_nlin_sym_09a_with_neck.nii"
- #input=${test_T1w##*/}
- #input=${input%%.*}
- #mov_im=$outdir/tmp/${input}_iso_biascorrected.nii.gz
- mov_im=$outdir/tmp/${base}_T1w_iso_biascorrected.nii.gz
- output="$outdir/warp2mni/${base}_T1w2MNI_"
- mkdir -p $outdir/warp2mni
- if [ ! -f $outdir/warp2mni/${base}_T1w2MNI_Warped.nii.gz ]; then
- echo " computing the spatial normalisation (warp) of the T1w to MNI (takes about 20 minutes)"
- my_cmd="antsRegistrationSyN.sh -d 3 -f ${fix_im} -m ${mov_im} \
- -o ${output} -n ${ncpu} -j 1 -t s $fs_silent"
- eval $my_cmd
- else
- echo " skipping MNI spatial normalisation, since it's already computed"
- fi
- fi
- # PART 4 - run fastsurfer (optional)
- if [ $deel -ge 4 ] && [ $fastsurf -gt 0 ]; then
- mkdir -p $outdir/fs
- #export FREESURFER_HOME=/usr/local/KUL_apps/freesurfer6
- #source $FREESURFER_HOME/SetUpFreeSurfer.sh
- if [ ! -f $outdir/fs/$base/mri/aparc.DKTatlas+aseg.deep.mgz ]; then
- if [ $fastsurf -eq 1 ]; then
- echo " running full fastsufer"
- my_cmd="$FASTSURFER_HOME/run_fastsurfer.sh \
- --sid $base --sd $outdir/fs \
- --t1 $test_T1w \
- --fs_license $FS_LICENSE \
- --py python --parallel --ignore_fs_version --threads $ncpu $fs_silent"
- elif [ $fastsurf -eq 2 ]; then
- echo " running segmentation-with-CC & stats fastsufer"
- my_cmd="$FASTSURFER_HOME/run_fastsurfer.sh \
- --sid $base --sd $outdir/fs \
- --t1 $test_T1w \
- --fs_license $FS_LICENSE \
- --seg_with_cc_only --py python --ignore_fs_version --threads $ncpu $fs_silent"
- elif [ $fastsurf -eq 3 ]; then
- echo " running segmentation-only fastsufer"
- my_cmd="$FASTSURFER_HOME/run_fastsurfer.sh \
- --sid $base --sd $outdir/fs \
- --t1 $test_T1w \
- --seg_only --py python --ignore_fs_version --threads $ncpu $fs_silent"
- fi
- eval $my_cmd
- else
- echo " fastsurfer seems to have run already"
- fi
- fi
- # PART 5 - MS lesion segmentation (optional)
- MSlesion="$outdir/rois/${base}_MSLesion.nii.gz"
- if [ $deel -ge 5 ] && [ $ms -eq 1 ];then
- if [ $flair -eq 1 ];then
- if [ ! -f $MSlesion ];then
- echo " running samseg (takes about 20 minutes)"
- T1w_iso="$outdir/tmp/${base}_T1w_iso_biascorrected.nii.gz"
- FLAIR_reg2T1w="$outdir/tmp/${base}_FLAIR_iso_biascorrected_reg2T1w.nii.gz"
- my_cmd="run_samseg --input $T1w_iso $FLAIR_reg2T1w --pallidum-separate \
- --lesion --lesion-mask-pattern 0 1 --output $outdir/samseg \
- --threads $ncpu $fs_silent"
- eval $my_cmd
- SamSeg="$outdir/samseg/seg.mgz"
- mrcalc $SamSeg 99 -eq $MSlesion -force -nthreads $ncpu
- else
- echo " already ran samseg"
- fi
- else
- echo " Warning! No Flair available to do lesion MS segmentation"
- fi
- fi
- # PART 6 - hd-bet and background search
- if [ $deel -ge 6 ];then
- # hd-bet brain extraction of the T1w
- if [ ! -f $outdir/tmp/${base}_T1w_iso_biascorrected_brain.nii.gz ]; then
- echo " doing hd-bet on ${base}_T1w_iso_biascorrected.nii.gz"
- my_cmd="hd-bet -i $outdir/tmp/${base}_T1w_iso_biascorrected.nii.gz \
- -o $outdir/tmp/${base}_T1w_iso_biascorrected_brain.nii.gz $fs_silent"
- eval $my_cmd
- mv $outdir/tmp/${base}_T1w_iso_biascorrected_brain_mask.nii.gz $outdir/masks
- else
- echo " skipping hd-bet on ${base}_T1w_iso_biascorrected.nii.gz - already done"
- fi
- # find the background by thresholding the T1w
- background="$outdir/masks/${base}_T1w_iso_biascorrected_background.nii.gz"
- if [ ! -f $background ]; then
- max_T1w=$(mrstats $outdir/tmp/${base}_T1w_iso_biascorrected.nii.gz -output max)
- echo " thresholding background using 0.5% of max signal of the T1w - $max_T1w"
- mrcalc $outdir/tmp/${base}_T1w_iso_biascorrected.nii.gz $max_T1w 0.005 -mul -lt \
- $background -force -nthreads $ncpu
- else
- echo " thresholding background already done"
- fi
- fi
- # PART 7 - Calibration
- check7="$outdir/histograms/${base}_T1w_iso_biascorrected_calib-nonlin3_histogram.csv"
- if [ $deel -ge 7 ] && [ ! -f $check7 ];then
- # -----------------------------------------------------------------------------------------------------------------------------
- # METHOD 1 - LINEAR histogram matching using eye/muscle tissue
- echo " performing linear histogram matching"
- M1_template_T1w="$kul_main_dir/atlasses/Local/Cappelle2021/tpl-MNI152NLin2009aSym_res-1_T1w.nii.gz"
- M1_template_T2w="$kul_main_dir/atlasses/Local/Cappelle2021/tpl-MNI152NLin2009aSym_res-1_T2w.nii.gz"
- M1_template_FLAIR="$kul_main_dir/atlasses/Local/Cappelle2021/tpl-MNI152NLin2009aSym_res-1_T2w.nii.gz"
- M1_template_mask_eye="$kul_main_dir/atlasses/Ganzetti2014/eyemask.nii"
- M1_template_mask_tempmuscle="$kul_main_dir/atlasses/Ganzetti2014/tempmask.nii"
- # Warp the eye and muscle back to subject space
- echo " warping eye/muscle and skull/air back to subject space"
- reference=$mov_im
- # REVIEW SARAH: There was a bug here in the order of transforms
- transform2="$outdir/warp2mni/${base}_T1w2MNI_1InverseWarp.nii.gz"
- transform1="[$outdir/warp2mni/${base}_T1w2MNI_0GenericAffine.mat,1]"
- interpolation_type="NearestNeighbor"
- input=$M1_template_mask_eye
- output="$outdir/masks/${base}_method1_eye.nii.gz"
- KUL_antsApply_Transform_MNI
- input=$M1_template_mask_tempmuscle
- output="$outdir/masks/${base}_method1_tempmuscle.nii.gz"
- KUL_antsApply_Transform_MNI
- # sum the masks
- mrcalc $outdir/masks/${base}_method1_eye.nii.gz $outdir/masks/${base}_method1_tempmuscle.nii.gz -add \
- $outdir/masks/${base}_method1_eye_and_muscle.nii.gz -nthreads $ncpu -force
- mrcalc $M1_template_mask_eye $M1_template_mask_tempmuscle -add \
- $outdir/masks/${base}_method1_mni_eye_and_muscle.nii.gz -nthreads $ncpu -force
- # do the LINEAR histogram matching using eye/muscle tissue
- mrhistmatch \
- -mask_input $outdir/masks/${base}_method1_eye_and_muscle.nii.gz \
- -mask_target $outdir/masks/${base}_method1_mni_eye_and_muscle.nii.gz \
- linear \
- $outdir/tmp/${base}_T1w_iso_biascorrected.nii.gz \
- $M1_template_T1w \
- $outdir/tmp/${base}_T1w_iso_biascorrected_calib-lin.nii.gz -nthreads $ncpu -force
- mrhistogram -bin 100 -ignorezero \
- $outdir/tmp/${base}_T1w_iso_biascorrected.nii.gz \
- $outdir/histograms/${base}_T1w_iso_biascorrected_histogram.csv -force
- mrhistogram -bin 100 -ignorezero \
- $outdir/tmp/${base}_T1w_iso_biascorrected_calib-lin.nii.gz \
- $outdir/histograms/${base}_T1w_iso_biascorrected_calib-lin_histogram.csv -nthreads $ncpu -force
- if [ $t2 -eq 1 ];then
- mrhistmatch \
- -mask_input $outdir/masks/${base}_method1_eye_and_muscle.nii.gz \
- -mask_target $outdir/masks/${base}_method1_mni_eye_and_muscle.nii.gz \
- linear \
- $outdir/tmp/${base}_T2w_iso_biascorrected_reg2T1w.nii.gz \
- $M1_template_T2w \
- $outdir/tmp/${base}_T2w_iso_biascorrected_calib-lin_reg2T1w.nii.gz -nthreads $ncpu -force
- mrhistogram -bin 100 -ignorezero \
- $outdir/tmp/${base}_T2w_iso_biascorrected_reg2T1w.nii.gz \
- $outdir/histograms/${base}_T2w_iso_biascorrected_reg2T1w_histogram.csv -force
- mrhistogram -bin 100 -ignorezero \
- $outdir/tmp/${base}_T2w_iso_biascorrected_calib-lin_reg2T1w.nii.gz \
- $outdir/histograms/${base}_T2w_iso_biascorrected_calib-lin_reg2T1w_histogram.csv -nthreads $ncpu -force
- fi
- if [ $flair -eq 1 ];then
- # Note: this is probably not a good calibration, since Ganzetti did not have a MNI-FLAIR
- mrhistmatch \
- -mask_input $outdir/masks/${base}_method1_eye_and_muscle.nii.gz \
- -mask_target $outdir/masks/${base}_method1_mni_eye_and_muscle.nii.gz \
- linear \
- $outdir/tmp/${base}_FLAIR_iso_biascorrected_reg2T1w.nii.gz \
- $M1_template_FLAIR \
- $outdir/tmp/${base}_FLAIR_iso_biascorrected_calib-lin_reg2T1w.nii.gz -nthreads $ncpu -force
- mrhistogram -bin 100 -ignorezero \
- $outdir/tmp/${base}_FLAIR_iso_biascorrected_reg2T1w.nii.gz \
- $outdir/histograms/${base}_FLAIR_iso_biascorrected_reg2T1w_histogram.csv -force
- mrhistogram -bin 100 -ignorezero \
- $outdir/tmp/${base}_FLAIR_iso_biascorrected_calib-lin_reg2T1w.nii.gz \
- $outdir/histograms/${base}_FLAIR_iso_biascorrected_calib-lin_reg2T1w_histogram.csv -nthreads $ncpu -force
- fi
- # -----------------------------------------------------------------------------------------------------------------------------
- # METHOD 2 - the NON-LINEAR histogram matching using non-brain tissue
- echo " performing nonlinear histogram matching"
- # Warp the brain_mask and its inverse to subject space
- M2_template_T1w="$kul_main_dir/atlasses/Local/Cappelle2021/tpl-MNI152NLin2009aSym_res-1_T1w.nii.gz"
- M2_template_T2w="$kul_main_dir/atlasses/Local/Cappelle2021/tpl-MNI152NLin2009aSym_res-1_T2w.nii.gz"
- M2_template_FLAIR="$kul_main_dir/atlasses/Local/Cappelle2021/tpl-MNI152NLin2009aSym_res-1_T2w.nii.gz"
- input="$kul_main_dir/atlasses/Ganzetti2014/brainmask_mni_dilated.nii"
- output="$outdir/masks/${base}_method2_MNI2subj_brainmask_mni_dilated.nii.gz"
- KUL_antsApply_Transform_MNI
- input="$kul_main_dir/atlasses/Ganzetti2014/brainmask_mni_dilated_inverse.nii"
- output="$outdir/masks/${base}_method2_MNI2subj_brainmask_mni_dilated_inverse.nii.gz"
- KUL_antsApply_Transform_MNI
- mrhistmatch \
- -mask_input $outdir/masks/${base}_method2_MNI2subj_brainmask_mni_dilated_inverse.nii.gz \
- -mask_target $kul_main_dir/atlasses/Ganzetti2014/brainmask_mni_dilated_inverse.nii \
- nonlinear \
- $outdir/tmp/${base}_T1w_iso_biascorrected.nii.gz \
- $M2_template_T1w \
- $outdir/tmp/${base}_T1w_iso_biascorrected_calib-nonlin.nii.gz -nthreads $ncpu -force
- mrhistogram -bin 100 -ignorezero \
- $outdir/tmp/${base}_T1w_iso_biascorrected_calib-nonlin.nii.gz \
- $outdir/histograms/${base}_T1w_iso_biascorrected_calib-nonlin_histogram.csv -nthreads $ncpu -force
- if [ $t2 -eq 1 ];then
- mrhistmatch \
- -mask_input $outdir/masks/${base}_method2_MNI2subj_brainmask_mni_dilated_inverse.nii.gz \
- -mask_target $kul_main_dir/atlasses/Ganzetti2014/brainmask_mni_dilated_inverse.nii \
- nonlinear \
- $outdir/tmp/${base}_T2w_iso_biascorrected_reg2T1w.nii.gz \
- $M2_template_T2w \
- $outdir/tmp/${base}_T2w_iso_biascorrected_calib-nonlin_reg2T1w.nii.gz -nthreads $ncpu -force
- mrhistogram -bin 100 -ignorezero \
- $outdir/tmp/${base}_T2w_iso_biascorrected_calib-nonlin_reg2T1w.nii.gz \
- $outdir/histograms/${base}_T2w_iso_biascorrected_calib-nonlin_reg2T1w_histogram.csv -nthreads $ncpu -force
- fi
- if [ $flair -eq 1 ];then
- mrhistmatch \
- -mask_input $outdir/masks/${base}_method2_MNI2subj_brainmask_mni_dilated_inverse.nii.gz \
- -mask_target $kul_main_dir/atlasses/Ganzetti2014/brainmask_mni_dilated_inverse.nii \
- nonlinear \
- $outdir/tmp/${base}_FLAIR_iso_biascorrected_reg2T1w.nii.gz \
- $M2_template_FLAIR \
- $outdir/tmp/${base}_FLAIR_iso_biascorrected_calib-nonlin_reg2T1w.nii.gz -nthreads $ncpu -force
- mrhistogram -bin 100 -ignorezero \
- $outdir/tmp/${base}_FLAIR_iso_biascorrected_calib-nonlin_reg2T1w.nii.gz \
- $outdir/histograms/${base}_FLAIR_iso_biascorrected_calib-nonlin_reg2T1w_histogram.csv -nthreads $ncpu -force
- fi
- # Method 3 - Cappelle & Sunaert
- echo " performing second (Cappelle) nonlinear histogram matching"
- M3_template_T1w="$kul_main_dir/atlasses/Local/Cappelle2021/tpl-MNI152NLin2009aSym_res-1_Cappelle2021_T1w.nii.gz"
- M3_template_T2w="$kul_main_dir/atlasses/Local/Cappelle2021/tpl-MNI152NLin2009aSym_res-1_Cappelle2021_T2w.nii.gz"
- M3_template_FLAIR="$kul_main_dir/atlasses/Local/Cappelle2021/tpl-MNI152NLin2009aSym_res-1_Cappelle2021_FLAIR.nii.gz"
- M3_template_mask_4_T1w="$kul_main_dir/atlasses/Local/Cappelle2021/tpl-MNI152NLin2009aSym_res-1_Cappelle2021_mask_4_T1w.nii.gz"
- M3_template_mask_4_T2w_and_FLAIR="$kul_main_dir/atlasses/Local/Cappelle2021/tpl-MNI152NLin2009aSym_res-1_Cappelle2021_mask_4_T2w_and_FLAIR.nii.gz"
- mask1="$outdir/masks/${base}_T1w_iso_biascorrected_brain_mask.nii.gz"
- mask2="$outdir/masks/${base}_T1w_iso_biascorrected_brain_inverted_mask.nii.gz"
- mrcalc $mask1 0.1 -lt $mask2 -nthreads $ncpu -force
- mask3="$outdir/masks/${base}_T1w_iso_biascorrected_brain_inverted_mask_nobackground.nii.gz"
- mrcalc $mask1 0.1 -lt $background -sub 0.1 -gt $mask3 -nthreads $ncpu -force
- # do the scond NON-LINEAR histogram matching using non-brain tissue
- mrhistmatch \
- -mask_input $mask3 \
- -mask_target $M3_template_mask_4_T1w \
- nonlinear \
- $outdir/tmp/${base}_T1w_iso_biascorrected.nii.gz \
- $M3_template_T1w \
- $outdir/tmp/${base}_T1w_iso_biascorrected_calib-nonlin2.nii.gz -nthreads $ncpu -force
- mrhistogram -bin 100 -ignorezero \
- $outdir/tmp/${base}_T1w_iso_biascorrected_calib-nonlin2.nii.gz \
- $outdir/histograms/${base}_T1w_iso_biascorrected_calib-nonlin2_histogram.csv -nthreads $ncpu -force
- if [ $t2 -eq 1 ];then
- td="T2w"
- # find the ventricles by thresholding the T2w
- max_T2w=$(mrstats $outdir/tmp/${base}_T2w_iso_biascorrected_reg2T1w.nii.gz -output max)
- echo " max signal of the T2w is $max_T2w"
- ventricles="$outdir/tmp/${base}_T2w_iso_biascorrected_reg2T1w_ventricules.nii.gz"
- mrcalc $outdir/tmp/${base}_T2w_iso_biascorrected_reg2T1w.nii.gz $max_T2w 0.75 -mul -gt \
- $ventricles -nthreads $ncpu -force
- skull_and_ventricules="$outdir/masks/${base}_T2w_iso_biascorrected_reg2T1w_skull_and_ventricules.nii.gz"
- mrcalc $mask3 $ventricles -add 0.1 -gt $skull_and_ventricules -nthreads $ncpu -force
- # do the scond NON-LINEAR histogram matching using non-brain tissue
- mrhistmatch \
- -mask_input $skull_and_ventricules \
- -mask_target $M3_template_mask_4_T2w_and_FLAIR \
- nonlinear \
- $outdir/tmp/${base}_${td}_iso_biascorrected_reg2T1w.nii.gz \
- $M3_template_T2w \
- $outdir/tmp/${base}_${td}_iso_biascorrected_calib-nonlin2_reg2T1w.nii.gz -nthreads $ncpu -force
- mrhistogram -bin 100 -ignorezero \
- $outdir/tmp/${base}_${td}_iso_biascorrected_calib-nonlin2_reg2T1w.nii.gz \
- $outdir/histograms/${base}_${td}_iso_biascorrected_calib-nonlin2_reg2T1w_histogram.csv -nthreads $ncpu -force
- fi
- if [ $flair -eq 1 ] && [ $t2 -eq 1 ];then
- td="FLAIR"
- # find the ventricles by thresholding the T2w
- max_T2w=$(mrstats $outdir/tmp/${base}_T2w_iso_biascorrected_reg2T1w.nii.gz -output max)
- echo " max signal of the T2w is $max_T2w"
- ventricles="$outdir/tmp/${base}_T2w_iso_biascorrected_reg2T1w_ventricules.nii.gz"
- mrcalc $outdir/tmp/${base}_T2w_iso_biascorrected_reg2T1w.nii.gz $max_T2w 0.75 -mul -gt \
- $ventricles -nthreads $ncpu -force
- skull_and_ventricules="$outdir/masks/${base}_FLAIR_iso_biascorrected_reg2T1w_skull_and_ventricules.nii.gz"
- mrcalc $mask3 $ventricles -add 0.1 -gt $skull_and_ventricules -nthreads $ncpu -force
- # do the scond NON-LINEAR histogram matching using non-brain tissue
- mrhistmatch \
- -mask_input $skull_and_ventricules \
- -mask_target $M3_template_mask_4_T2w_and_FLAIR \
- nonlinear \
- $outdir/tmp/${base}_${td}_iso_biascorrected_reg2T1w.nii.gz \
- $M3_template_FLAIR \
- $outdir/tmp/${base}_${td}_iso_biascorrected_calib-nonlin2_reg2T1w.nii.gz -nthreads $ncpu -force
- mrhistogram -bin 100 -ignorezero \
- $outdir/tmp/${base}_${td}_iso_biascorrected_calib-nonlin2_reg2T1w.nii.gz \
- $outdir/histograms/${base}_${td}_iso_biascorrected_calib-nonlin2_reg2T1w_histogram.csv -nthreads $ncpu -force
- fi
- # Last method of calibration
- # do it in the whole image except for the MS lesions
- M4_template_T1w=$M3_template_T1w
- M4_template_T2w=$M3_template_T2w
- M4_template_FLAIR=$M3_template_FLAIR
- M4_template_mask="$kul_main_dir/atlasses/Local/Cappelle2021/tpl-MNI152NLin2009aSym_res-1_Cappelle2021_T1w_mask_brain_mask.nii.gz"
- mask1="$outdir/masks/${base}_T1w_iso_biascorrected_brain_mask.nii.gz"
- mask_subj="$outdir/masks/${base}_method4_brain_mask_without_lesions.nii.gz"
- MSlesion_dilated="$outdir/masks/${base}_method4_MSlesion_dilated.nii.gz"
- maskfilter $MSlesion dilate $MSlesion_dilated -force
- mrcalc $mask1 $MSlesion_dilated -subtract $mask_subj -nthreads $ncpu -force
- mrhistmatch \
- -mask_input $mask_subj \
- -mask_target $M4_template_mask \
- nonlinear \
- $outdir/tmp/${base}_T1w_iso_biascorrected.nii.gz \
- $M4_template_T1w \
- $outdir/tmp/${base}_T1w_iso_biascorrected_calib-nonlin3.nii.gz -nthreads $ncpu -force
- mrhistogram -bin 100 -ignorezero \
- $outdir/tmp/${base}_T1w_iso_biascorrected_calib-nonlin3.nii.gz \
- $outdir/histograms/${base}_T1w_iso_biascorrected_calib-nonlin3_histogram.csv -nthreads $ncpu -force
- if [ $t2 -eq 1 ];then
- mrhistmatch \
- -mask_input $mask_subj \
- -mask_target $M4_template_mask \
- nonlinear \
- $outdir/tmp/${base}_T2w_iso_biascorrected_reg2T1w.nii.gz \
- $M4_template_T2w \
- $outdir/tmp/${base}_T2w_iso_biascorrected_calib-nonlin3_reg2T1w.nii.gz -nthreads $ncpu -force
- mrhistogram -bin 100 -ignorezero \
- $outdir/tmp/${base}_T2w_iso_biascorrected_calib-nonlin3_reg2T1w.nii.gz \
- $outdir/histograms/${base}_T2w_iso_biascorrected_calib-nonlin3_histogram.csv -nthreads $ncpu -force
- fi
- if [ $flair -eq 1 ];then
- mrhistmatch \
- -mask_input $mask_subj \
- -mask_target $M4_template_mask \
- nonlinear \
- $outdir/tmp/${base}_FLAIR_iso_biascorrected_reg2T1w.nii.gz \
- $M4_template_FLAIR \
- $outdir/tmp/${base}_FLAIR_iso_biascorrected_calib-nonlin3_reg2T1w.nii.gz -nthreads $ncpu -force
- mrhistogram -bin 100 -ignorezero \
- $outdir/tmp/${base}_FLAIR_iso_biascorrected_calib-nonlin3_reg2T1w.nii.gz \
- $outdir/histograms/${base}_FLAIR_iso_biascorrected_calib-nonlin3_histogram.csv -nthreads $ncpu -force
- fi
- fi
- # PART 8 - compute the ratio
- if [ $deel -ge 8 ];then
- if [ $t2 -eq 1 ];then
- td="T2w"
- KUL_computeratio
- fi
- if [ $flair -eq 1 ];then
- td="FLAIR"
- KUL_computeratio
- fi
- fi
- # PART 9 - MTI and MTR
- test_done_MTI="$outdir/${base}_ratio-MTC_MNI.nii.gz"
- if [ $deel -ge 9 ] && [ $mti -eq 1 ] && [ ! -f $test_done_MTI ];then
- input=$test_MTI
- output=${test_MTI##*/}
- output=${output%%.*}
- echo " doing hd-bet of the MTI"
- KUL_MTI_reorient_crop_hdbet_iso
- td="MTI"
- echo " coregistering MTI to T1 and computing the MTC ratio"
- KUL_MTI_register_computeratio
- fi
- # PART 10 - warping results to mni too
- if [ $deel -ge 10 ];then
- td="T1w"
- KUL_apply_warp2mni
- if [ $t2 -eq 1 ];then
- td="T2w"
- KUL_apply_warp2mni
- fi
- if [ $flair -eq 1 ];then
- td="FLAIR"
- KUL_apply_warp2mni
- fi
- if [ $mti -eq 1 ];then
- td="MTI"
- KUL_apply_warp2mni
- fi
- fi
- #rm -fr $outdir/tmp/${base}*.gz
- #cd T1T2FLAIRMTR_ratio/tmp/
- #rm -fr *std.nii.gz *iso.nii.gz *ted.nii.gz *reg2T1w.nii.gz *mask.nii.gz *eye.nii.gz *muscle.nii.gz *.csv *MTI* *MNI.nii.gz *verse.nii.gz *inv.nii.gz *brain.nii.gz
- #rm -fr *std.nii.gz *iso.nii.gz *ted.nii.gz *reg2T1w.nii.gz *eye.nii.gz *muscle.nii.gz *.csv *MTI* *MNI.nii.gz *verse.nii.gz *inv.nii.gz *brain.nii.gz
- #cd ../..
- echo ${deel} > $check_done
- echo " done"
- else
- echo " Nothing to do here"
- fi
- fi
- else
- echo " $base already done"
- fi
- done
KUL_T1T2FLAIRMTR_ratio.sh at commit 2c11248, under MPL-2.0 · at the source
Overview
- Department of Biomedical, Surgical and Dental Sciences, University of Milan, Milan, Italy
- Neurodegenerative Diseases Unit, Fondazione IRCCS Ca' Granda, Ospedale Maggiore Policlinico, Milan, Italy
- Department of Biomedical Sciences for Health, University of Milan, Milan, Italy
- Department of Neuroscience, Rehabilitation, Ophthalmology, Genetics, Maternal and Child Health (DiNOGMI), University of Genoa, Genoa, Italy
- IRCCS Ospedale Policlinico San Martino, Genoa, Italy
- Neuroradiology Unit, Fondazione IRCCS Ca’ Granda, Ospedale Maggiore Policlinico, Milan, Italy
- Department of Pathophysiology and Transplantation, University of Milan, Milan, Italy
- Department of Neurosciences “Rita Levi Montalcini”, University of Turin, Turin, Italy
- Cardiff University Brain Research Imaging Centre, School of Psychology, Cardiff University, Cardiff, UK
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repository
Its files are read in the Code ↔ Paper reader above, with 3 matches between paragraphs and lines of code.
treanus/KUL_NIS
2c11248436041bffa0a63ae7f819317b03efb3ad, 18 August 2023Availability: 2 checks, the latest on 1 November 2026: the link answers
- 1 November 2026: the link answers
- 29 September 2026: the link answers
59 files
- KUL_BIDS_clean.py, Python, 127 lines
- KUL_DRT.sh, Shell, 322 lines
- KUL_EDs_b2masks.py, Python, 390 lines
- KUL_MRtrix3_connectome.s
h , Shell, 202 lines - KUL_MS_lesion_stats.sh, Shell, 496 lines
- KUL_T1T2FLAIRMTR_ratio.s
h , Shell, 998 lines, 2 matches - KUL_VSC_prepare_dwiprep.
sh , Shell, 48 lines - KUL_anat_biascorrect.sh, Shell, 214 lines
- KUL_anat_lesionheatmap.s
h , Shell, 243 lines - KUL_anat_register.sh, Shell, 533 lines
- KUL_anat_segment_tumor.s
h , Shell, 577 lines - KUL_bids_crop.sh, Shell, 137 lines
- KUL_bids_summary.sh, Shell, 112 lines
- KUL_clinical_fmridti.sh, Shell, 1,342 lines
- KUL_dcm2bids.py, Python, 173 lines
- KUL_dcm2bids.sh, Shell, 1,588 lines
- KUL_dcm2bids_new.sh, Shell, 1,591 lines
- KUL_dwiprep.sh, Shell, 923 lines
- KUL_dwiprep_FT.sh, Shell, 1,343 lines
- KUL_dwiprep_MNI.sh, Shell, 238 lines
- KUL_dwiprep_anat.sh, Shell, 609 lines
- KUL_dwiprep_fibertract.s
h , Shell, 514 lines - KUL_dwiprep_group_fba.sh
, Shell, 856 lines - KUL_dwiprep_group_fba_bk
up.sh , Shell, 801 lines - KUL_fmriproc_conn.sh, Shell, 268 lines
- KUL_fmriproc_spm.sh, Shell, 375 lines
- KUL_karawun2brainlab.sh, Shell, 248 lines
- KUL_karawun_prepare.sh, Shell, 416 lines
- KUL_lesion_fs_recall.sh, Shell, 1,327 lines, 1 match
- KUL_linux_givebackmyfile
s.sh , Shell, 9 lines - KUL_main_functions.sh, Shell, 417 lines
- KUL_make_fMRI_labels.sh, Shell, 101 lines
- KUL_mrview_figure.sh, Shell, 335 lines
- KUL_multisubjects_dcm2bi
ds.sh , Shell, 239 lines - KUL_nii2dcm.py, Python, 244 lines
- KUL_preproc_all.sh, Shell, 1,853 lines
- KUL_qsiprep.sh, Shell, 484 lines
- KUL_radsyndisco.sh, Shell, 191 lines
- KUL_reg_pwi_2_T1.sh, Shell, 48 lines
- KUL_synb0.sh, Shell, 313 lines
- VSC/
Env_T1T2FLAIRMTR_cpu.sh , Shell, 35 lines - VSC/
Env_T1T2FLAIRMTR_gpu.sh , Shell, 35 lines - build_singularity/
KUL_build_singularity.sh , Shell, 18 lines - debug/
test_kul_task_exec.sh , Shell, 24 lines - share/
spm12/ , MATLAB, 12 linesspm12_fmri_stats_1run.m - share/
spm12/ , MATLAB, 43 linesspm12_fmri_stats_1run_jo b.m - share/
spm12/ , MATLAB, 12 linesspm12_fmri_stats_2runs.m - share/
spm12/ , MATLAB, 61 linesspm12_fmri_stats_2runs_j ob.m - share/
spm12/ , MATLAB, 12 linesspm12_fmri_stats_3runs.m - share/
spm12/ , MATLAB, 79 linesspm12_fmri_stats_3runs_j ob.m - studies/
cappelle2021/ , MATLAB, 142 linesKUL_plot_histograms.m - studies/
cappelle2021/ , MATLAB, 174 linesKUL_plot_stats.m - studies/
cappelle2021/ , Python, 124 linesKUL_samseg_longitudinal. py - studies/
cappelle2021/ , Python, 114 linesKUL_warp_lesions2mni.py - studies/
cappelle2021/ , Shell, 43 linesconvert2bids.sh - studies/
cappelle2021/ , Shell, 49 linesconvert_extra2bids.sh - studies/
verhaaren2022/ , Python, 318 linesKUL_DRT_determine_positi on.py - License.txt, License, 373 lines
- README.md, Text, 127 lines
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 57 scripts, each with its path and the digest of its content;
- 3 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data availability statement
The paper has a data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it says that the data are available on request
Read it in the paper: doi.org/10.1002/hbm.70603.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 1 October 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 15 authors, 5 keywords, 15 MeSH terms, 4 funders, 96 references.
Cite
This paper
Sacchi, L., Farruggio, G., Bocca, G., Carandini, T., De Riz, M., Ghezzi, L., Pintus, M., Pietroboni, A., Boffa, G., Scola, E., Triulzi, F., Bozzali, M., Galimberti, D., Cercignani, M., & Arighi, A. (2026). DTI-ALPS Primarily Reflects White Matter Diffusion Dispersion and Microstructural Heterogeneity in Neurodegeneration: Insights From Multi-Modal MRI. Human brain mapping, 47(14), e70603. https://
BibTeX
@article{sacchi2026dti,
author = {Sacchi, Luca and Farruggio, Giovanni and Bocca, Giorgio and Carandini, Tiziana and De Riz, Milena and Ghezzi, Laura and Pintus, Manuela and Pietroboni, Anna and Boffa, Giacomo and Scola, Elisa and Triulzi, Fabio and Bozzali, Marco and Galimberti, Daniela and Cercignani, Mara and Arighi, Andrea},
title = {{DTI-ALPS Primarily Reflects White Matter Diffusion Dispersion and Microstructural Heterogeneity in Neurodegeneration: Insights From Multi-Modal MRI}},
journal = {Human brain mapping},
year = {2026},
month = oct,
volume = {47},
number = {14},
pages = {e70603},
publisher = {Wiley},
issn = {1065-9471},
doi = {10.1002/
url = {https://
pmid = {42786724},
pmcid = {PMC13612971}
}
RIS
TY - JOUR
AU - Sacchi, Luca
AU - Farruggio, Giovanni
AU - Bocca, Giorgio
AU - Carandini, Tiziana
AU - De Riz, Milena
AU - Ghezzi, Laura
AU - Pintus, Manuela
AU - Pietroboni, Anna
AU - Boffa, Giacomo
AU - Scola, Elisa
AU - Triulzi, Fabio
AU - Bozzali, Marco
AU - Galimberti, Daniela
AU - Cercignani, Mara
AU - Arighi, Andrea
TI - DTI-ALPS Primarily Reflects White Matter Diffusion Dispersion and Microstructural Heterogeneity in Neurodegeneration: Insights From Multi-Modal MRI
T2 - Human brain mapping
J2 - Hum Brain Mapp
PY - 2026
DA - 2026/
VL - 47
IS - 14
SP - e70603
SN - 1065-9471
PB - Wiley
DO - 10.1002/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1002/
"type": "article-journal",
"title": "DTI-ALPS Primarily Reflects White Matter Diffusion Dispersion and Microstructural Heterogeneity in Neurodegeneration: Insights From Multi-Modal MRI",
"container-title": "Human brain mapping",
"author": [
{
"family": "Sacchi",
"given": "Luca"
},
{
"family": "Farruggio",
"given": "Giovanni"
},
{
"family": "Bocca",
"given": "Giorgio"
},
{
"family": "Carandini",
"given": "Tiziana"
},
{
"family": "De Riz",
"given": "Milena"
},
{
"family": "Ghezzi",
"given": "Laura"
},
{
"family": "Pintus",
"given": "Manuela"
},
{
"family": "Pietroboni",
"given": "Anna"
},
{
"family": "Boffa",
"given": "Giacomo"
},
{
"family": "Scola",
"given": "Elisa"
},
{
"family": "Triulzi",
"given": "Fabio"
},
{
"family": "Bozzali",
"given": "Marco"
},
{
"family": "Galimberti",
"given": "Daniela"
},
{
"family": "Cercignani",
"given": "Mara"
},
{
"family": "Arighi",
"given": "Andrea"
}
],
"container-title-short":
"volume": "47",
"issue": "14",
"page": "e70603",
"DOI": "10.1002/
"PMID": "42786724",
"PMCID": "PMC13612971",
"ISSN": "1065-9471",
"publisher": "Wiley",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
10,
1
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1007/s00234-025-03875-9 [code]
- Evaluating the T1w/
FLAIR ratio as a proxy for myelin: Associations with myelin water Imaging, diffusion metrics, and cognition. Journal: NeuroradiologyIn common: Dcm2Bids, MRIQC, BIDS Validator, 12 other tools, structural MRI / diffusion, 8 references - [2] doi:10.1016/j.nicl.2022.103248 [code]
- T1w/
FLAIR ratio standardization as a myelin marker in MS patients. Journal: NeuroImage. ClinicalIn common: Dcm2Bids, MRIQC, BIDS Validator, 12 other tools, structural MRI / diffusion, 6 references - [3] doi:10.1162/imag.a.122 [code]
- Neural micro and macrostructural correlates of visual outcomes in children with unilateral cerebral palsy: A fixel-based study.Journal: Imaging neuroscience (Cambridge, Mass.)In common: Dcm2Bids, MRIQC, BIDS Validator, 12 other tools, structural MRI / diffusion, other condition, 4 references
- [4] doi:10.1093/braincomms/fcag129 [code]
- Longitudinal changes of choroid plexus volumes and MRI ratios in multiple sclerosis.Journal: Brain communicationsIn common: Dcm2Bids, MRIQC, BIDS Validator, 12 other tools, structural MRI / diffusion, 2 references
- [5] doi:10.1007/s00221-023-06545-5 [code]
- Longitudinal changes in global structural brain connectivity and cognitive performance in former hospitalized COVID-19 survivors: an exploratory study.Journal: Experimental brain researchIn common: Dcm2Bids, MRIQC, BIDS Validator, 12 other tools, structural MRI / diffusion, other condition, 1 reference
- [6] doi:10.1017/s0033291724003362 [code]
- Gray and white matter differences in the medial temporal lobe in late-life depression: a multimodal PET-MRI investigation.Journal: Psychological medicineIn common: Dcm2Bids, MRIQC, BIDS Validator, 12 other tools, structural MRI / diffusion
- [7] doi:10.1038/s41598-023-42429-y [code]
- A cross-sectional case-control study on the structural connectome in recovered hospitalized COVID-19 patients.Journal: Scientific reportsIn common: Dcm2Bids, MRIQC, BIDS Validator, 12 other tools, other condition
- [8] doi:10.1002/mds.30325 [code]
- Impaired Glymphatic Clearance, Measured Using Diffusion Tensor Image Analysis Along the Perivascular Space (DTI-ALPS), is Linked to Poor Cognitive Outcomes in Parkinson's Disease.Journal: Movement disorders : official journal of the Movement Disorder SocietyIn common: Alzheimer's / dementia, structural MRI / diffusion, 14 references
- [9] doi:10.1038/s41531-025-01257-9 [code]
- Alterations of cerebrospinal fluid flow dynamics in Parkinson's disease.Journal: NPJ Parkinson's diseaseIn common: ANTs, FreeSurfer, FSL, 4 other tools, structural MRI / diffusion, 8 references
- [10] doi:10.1162/netn_a_00330 [code]
- The human brain connectome weighted by the myelin content and total intra-axonal cross-sectional area of white matter tracts.Journal: Network neuroscience (Cambridge, Mass.)In common: MRtrix3, ANTs, FreeSurfer, 7 other tools, structural MRI / diffusion, 7 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 57 scripts, and 3 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:03ead8cc5cb04105…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1002/hbm.70603)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1002/hbm.70603.svg
:target: https://openscicode.org/badge/doi/10.1002/hbm.70603
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1002/hbm.70603"><img src="https://openscicode.org/badge/doi/10.1002/hbm.70603.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
