DTI_ALPS

#!/bin/bash
#              /DM01.bvec
#/path/DTI/DM01/DM01.nii.gz
#              /DM01.bval
#
#              /DM02.bvec
#/path/DTI/DM02/DM02.nii.gz
#              /DM02.bval

#              /HC01.bvec
#/path/DTI/HC01/HC01.nii.gz
#              /HC01.bval
#
path=/media/kui/Passport5T/DATA_help/data
mkdir ${path}/Results_DTI_ALPS

cd ${path}/DTI

ls >${path}/subj.txt

for sub in `cat ${path}/subj.txt`
do 
cd ${path}/DTI/$sub
echo $sub

echo 'step1:extract B0'
fslroi $sub.nii.gz B0.nii.gz 0 1


echo 'step2:bet'
bet B0.nii.gz nodiff_brain -R -f 0.2 -g 0 -m


echo 'step3:eddy'
eddy_correct $sub.nii.gz data.nii.gz 0


echo 'step4:calculate tensor'
dtifit --data=data.nii.gz --out=dti --mask=nodiff_brain_mask.nii.gz --bvecs=$sub.bvec --bvals=$sub.bval --save_tensor

fslroi dti_tensor.nii.gz ${sub}_dxx 0 1
fslroi dti_tensor.nii.gz ${sub}_dyy 3 1
fslroi dti_tensor.nii.gz ${sub}_dzz 5 1


echo 'step5:flirt onestep dxx2MNIFA'
/usr/local/fsl/bin/flirt -in ${path}/DTI/$sub/${sub}_dxx.nii.gz -ref /usr/local/fsl/data/standard/FSL_HCP1065_FA_1mm.nii.gz -out ${path}/DTI/$sub/${sub}_dxx2MNI_FA.nii.gz -omat ${path}/DTI/$sub/${sub}_dxx2MNI_FA.mat -bins 256 -cost corratio -searchrx -90 90 -searchry -90 90 -searchrz -90 90 -dof 12  -interp trilinear


/usr/local/fsl/bin/flirt -in ${path}/DTI/$sub/${sub}_dyy.nii.gz -ref /usr/local/fsl/data/standard/FSL_HCP1065_FA_1mm.nii.gz -out ${path}/DTI/$sub/${sub}_dxx2MNI_FA_shadowreg_dyy.nii.gz -applyxfm -init ${path}/DTI/$sub/${sub}_dxx2MNI_FA.mat -interp trilinear


/usr/local/fsl/bin/flirt -in ${path}/DTI/$sub/${sub}_dzz.nii.gz -ref /usr/local/fsl/data/standard/FSL_HCP1065_FA_1mm.nii.gz -out ${path}/DTI/$sub/${sub}_dxx2MNI_FA_shadowreg_dzz.nii.gz -applyxfm -init ${path}/DTI/$sub/${sub}_dxx2MNI_FA.mat -interp trilinear

echo 'step6:mv'
mkdir ${path}/Results_DTI_ALPS/$sub
mv ${path}/DTI/$sub/${sub}_dxx2MNI_FA.nii.gz ${path}/Results_DTI_ALPS/$sub/${sub}_dxx.nii.gz
mv ${path}/DTI/$sub/${sub}_dxx2MNI_FA_shadowreg_dyy.nii.gz ${path}/Results_DTI_ALPS/$sub/${sub}_dyy.nii.gz
mv ${path}/DTI/$sub/${sub}_dxx2MNI_FA_shadowreg_dzz.nii.gz ${path}/Results_DTI_ALPS/$sub/${sub}_dzz.nii.gz

echo 'fslstats'
cd ${path}

fslstats -t ${path}/Results_DTI_ALPS/$sub/${sub}_dxx.nii.gz -k ${path}/FSL_HCP1065_FA_1mm_mask_proj.nii.gz -M >> dxxproj_meants.txt

fslstats -t ${path}/Results_DTI_ALPS/$sub/${sub}_dxx.nii.gz -k ${path}/FSL_HCP1065_FA_1mm_mask_asso.nii.gz -M >> dxxasso_meants.txt

fslstats -t ${path}/Results_DTI_ALPS/$sub/${sub}_dyy.nii.gz -k ${path}/FSL_HCP1065_FA_1mm_mask_proj.nii.gz -M >> dyyproj_meants.txt

fslstats -t ${path}/Results_DTI_ALPS/$sub/${sub}_dzz.nii.gz -k ${path}/FSL_HCP1065_FA_1mm_mask_asso.nii.gz -M >> dzzasso_meants.txt
done

可能存在的问题:配准方式的选择;是否需要平滑smooth;roi的勾画问题。
哔哩哔哩roi勾画方法1
DTI–ALPS绘制ROI及提值操作(沿血管周围间隙的弥散张量计算)
FA伪彩和roi勾画

你可能感兴趣的:(fsl)