Commit fee603e2 authored by Ludovica Griffanti's avatar Ludovica Griffanti
Browse files

Upload bb_tbss_md_NAWM.sh

parent e58072ba
#!/bin/bash
. "$BB_BIN_DIR"/bb_pipeline_tools/bb_set_header
direc="$PWD"/"$1"
TBSSDir="$direc"/dMRI/TBSS
biancaDIR="$direc"/T2_FLAIR/lesions/
################# Apply FNRIT warp to WMH to have WMH_to_MNI.nii.gz
cd "$biancaDIR"
$FSLDIR/bin/applywarp -i final_mask.nii.gz -o final_mask_to_MNI.nii.gz -r ${FSLDIR}/data/standard/MNI152_T1_1mm.nii.gz -w ../../T1/transforms/T1_to_MNI_warp.nii.gz
################# Calculating IDPs masking out WMH
cd "$TBSSDir"
cd stats
fslmaths ${biancaDIR}/final_mask_to_MNI.nii.gz -thr 0.2 -binv -mul all_MD all_MD_NAWM
fslmaths all_MD_NAWM -mas mean_FA_skeleton_mask all_MD_NAWM_skeletonised
fslstats -K ${FSLDIR}/data/atlases/JHU/JHU-ICBM-labels-1mm all_MD_NAWM_skeletonised.nii.gz -M >JHUrois_MD_NAWM.txt
cd ../..
################# Saving IDPs in the main IDPs directory
#Setting the string of NaN in case there is a problem.
numVars="48"
nanResult="";
for i in $(seq 1 $numVars) ; do
nanResult="NaN $nanResult" ;
done
result=""
#for i in FA MD ; do
for i in MD_NAWM ; do
if [ -f ${TBSSDir}/stats/JHUrois_${i}.txt ] ; then
if [ `cat ${TBSSDir}/stats/JHUrois_${i}.txt | wc -w` = $numVars ] ; then
miniResult=`cat ${TBSSDir}/stats/JHUrois_${i}.txt`
else
miniResult="$nanResult"
fi
else
miniResult="$nanResult"
fi
result="$result $miniResult"
done
echo $result > ${direc}/IDP_files/bb_IDP_diff_TBSS_NAWM.txt
done
. "$BB_BIN_DIR"/bb_pipeline_tools/bb_set_footer
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment