Longitudinal changes of choroid plexus volumes and MRI ratios in multiple sclerosis.
The 1 match
- [1] § Materials and methods › Image processing ↔ KUL_T1T2FLAIRMTR_ratio.sh, lines 733–787 · score 0.65 · linear histogram matching, brain tissue, transformation, template, ratios, masks
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Shell · 998 lines · 44 KB · MPL-2.0 · 1 match
- #!/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
- Ruhr University Bochum, St. Josef Hospital, Institute of Neuroradiology, 44791 Bochum, Germany
- Ruhr University Bochum, St. Josef Hospital, Department of Neurology, 44791 Bochum, Germany
Abstract
This longitudinal study aimed to identify the predictive role of choroid plexus enlargement for disability progression and its association with tissue damage in early multiple sclerosis patients. Forty patients with clinically isolated syndrome or early relapsing–remitting multiple sclerosis underwent brain MRI scanning at baseline, after 2 and after 6–8 years. FreeSurfer segmentation was used for brain volume estimation, and the choroid plexus was segmented by use of an independent automated segmentation tool. MRI ratios (T1 weighted through fluid attenuated inversion recovery image values) were calculated after calibration and subtracting lesion masks. Lesion masks were eroded to obtain both lesion rims and centres, for which mean ratios were extracted in addition to normal-appearing white matter. Expanded Disability Status Scale and disease duration were collected from neurological examination. Between baseline and last follow-up, choroid plexus volumes increased, and MRI ratios in lesions decreased significantly, which was dominated by the decrease in clinically isolated syndrome rather than relapsing–remitting patients and more pronounced in lesion rims than in their centre. Choroid plexus volumes were significantly related to MRI ratios within rims of lesions at baseline and within lesion centres after 6–8 years, but not within normal-appearing white matter. No associations between choroid plexus volumes or ratios and disability were found. We observed longitudinal changes of both choroid plexus enlargement and MRI ratios over 6–8 years in early multiple sclerosis patients. Choroid plexus enlargement seemed involved in the dynamic development of lesion destructivity.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repositories
Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.
treanus/KUL_NIS
2c11248436041bffa0a63ae7f819317b03efb3ad, 18 August 2023Availability: 1 check, the latest on 29 September 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, 1 match - 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
- 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
Center-of-Imaging-Biomarker-Development/chp_seg
c00eaa243d7a2e749a254489d3b8c48197f70f5c, 2 June 2025Availability: 1 check, the latest on 29 September 2026: the link answers
- 29 September 2026: the link answers
1 file
- README.md, Text, 161 lines
The paper's code and data availability statement is in the Data section.
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:
- 2 repositories 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;
- 1 match 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
Raw MRI and clinical data cannot be made available due to data protection regulations. The pipeline used for the creation of T1w/
Reproduced under the paper's license (CC BY), from the paper cited above.
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, 29 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 9 authors, 5 keywords, 43 references.
Cite
This paper
Krieger, B., Bellenberg, B., Müller, D., Sbaihat, H., Roenneke, A. K., Ladopoulos, T., Schneider, R., Gold, R., & Lukas, C. (2026). Longitudinal changes of choroid plexus volumes and MRI ratios in multiple sclerosis. Brain communications, 8(3), fcag129. https://
BibTeX
@article{krieger2026long
author = {Krieger, Britta and Bellenberg, Barbara and Müller, Dajana and Sbaihat, Hasan and Roenneke, Anna Katharina and Ladopoulos, Theodoros and Schneider, Ruth and Gold, Ralf and Lukas, Carsten},
title = {{Longitudinal changes of choroid plexus volumes and MRI ratios in multiple sclerosis}},
journal = {Brain communications},
year = {2026},
month = apr,
volume = {8},
number = {3},
pages = {fcag129},
publisher = {Oxford University Press},
issn = {2632-1297},
doi = {10.1093/
url = {https://
pmid = {42158849},
pmcid = {PMC13180650}
}
RIS
TY - JOUR
AU - Krieger, Britta
AU - Bellenberg, Barbara
AU - Müller, Dajana
AU - Sbaihat, Hasan
AU - Roenneke, Anna Katharina
AU - Ladopoulos, Theodoros
AU - Schneider, Ruth
AU - Gold, Ralf
AU - Lukas, Carsten
TI - Longitudinal changes of choroid plexus volumes and MRI ratios in multiple sclerosis
T2 - Brain communications
J2 - Brain Commun
PY - 2026
DA - 2026/
VL - 8
IS - 3
SP - fcag129
SN - 2632-1297
PB - Oxford University Press
DO - 10.1093/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1093/
"type": "article-journal",
"title": "Longitudinal changes of choroid plexus volumes and MRI ratios in multiple sclerosis",
"container-title": "Brain communications",
"author": [
{
"family": "Krieger",
"given": "Britta"
},
{
"family": "Bellenberg",
"given": "Barbara"
},
{
"family": "Müller",
"given": "Dajana"
},
{
"family": "Sbaihat",
"given": "Hasan"
},
{
"family": "Roenneke",
"given": "Anna Katharina"
},
{
"family": "Ladopoulos",
"given": "Theodoros"
},
{
"family": "Schneider",
"given": "Ruth"
},
{
"family": "Gold",
"given": "Ralf"
},
{
"family": "Lukas",
"given": "Carsten"
}
],
"container-title-short":
"volume": "8",
"issue": "3",
"page": "fcag129",
"DOI": "10.1093/
"PMID": "42158849",
"PMCID": "PMC13180650",
"ISSN": "2632-1297",
"publisher": "Oxford University Press",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
18
]
]
}
}
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.1162/imag.a.1252 [code]
- Does the brain's E:I balance really shape long-range temporal correlations? Lessons learned from 3T MRI.Journal: Imaging neuroscience (Cambridge, Mass.)In common: MRIQC, Dcm2Bids, fMRIPrep, 7 other tools, structural MRI / diffusion
- [2] doi:10.1162/imag.a.1347 [code]
- Neural and behavioural correlates of theory of mind reasoning in five-year-old children born preterm.Journal: Imaging neuroscience (Cambridge, Mass.)In common: MRIQC, Dcm2Bids, fMRIPrep, 7 other tools
- [3] doi:10.1016/j.dcn.2026.101765 [code]
- Fusiform face area development correlates with development in higher-order social brain regions.Journal: Developmental cognitive neuroscienceIn common: MRIQC, Dcm2Bids, fMRIPrep, 7 other tools
- [4] doi:10.1038/s41467-026-71568-9 [code]
- Convergent and selective representations of pain, appetitive processes, aversive processes, and cognitive control in the insula.Journal: Nature communicationsIn common: fMRIPrep, MRtrix3, ANTs, 8 other tools
- [5] doi:10.1038/s41467-026-71151-2 [code]
- Common and distinct neural correlates of social interaction processing and theory of mind in narratives.Journal: Nature communicationsIn common: fMRIPrep, MRtrix3, ANTs, 8 other tools
- [6] doi:10.1038/s41467-026-71719-y [code]
- Brain functional-structural gradient coupling reflects development, behavior and genetic influences.Journal: Nature communicationsIn common: Dcm2Bids, MRtrix3, ANTs, 7 other tools
- [7] doi:10.1038/s41597-026-07676-4 [code]
- A neuroimaging dataset combining movie-watching, eye-tracking, sensorimotor mapping, and cognitive tasks.Journal: Scientific dataIn common: BIDS Validator, FreeSurfer, FSL, 6 other tools, structural MRI / diffusion, 1 reference
- [8] doi:10.1371/journal.pbio.3003856 [code]
- Aging and metabolism contribute separately to brain-body health.Journal: PLoS biologyIn common: ANTs, FreeSurfer, FSL, 6 other tools, structural MRI / diffusion, clinical / translational, 1 reference
- [9] doi:10.1038/s41467-026-73668-y [code]
- Convergent and divergent brain-cognition development in early adolescence.Journal: Nature communicationsIn common: MRtrix3, ANTs, FreeSurfer, 7 other tools
- [10] doi:10.1038/s41467-026-71918-7 [code]
- Developmental disinhibition gates language lateralization in childhood.Journal: Nature communicationsIn common: MRtrix3, ANTs, FreeSurfer, 6 other tools, 1 reference
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: 2 repositories of the authors' code, each at its verified commit and with its license, 57 scripts, and 1 match 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:4e67d84471705de5…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
