标签:
这一步主要是从FA图像中计算出每个ROI的FA值。
1 下载连接中的文件:http://enigma.ini.usc.edu/wp-content/uploads/2012/06/ROIextraction_info.zip,解压该文件,名将ROIextraction_info文件夹移动到FA_individ同一目录下
2 新建一个文件并命名为run_ROI_part1.sh,代码如下:
mkdir ENIGMA_ROI_part1
dirO1=./ENIGMA_ROI_part1/
for subj in {1..89}
do
./ROIextraction_info/singleSubjROI_exe ./ROIextraction_info/ENIGMA_look_up_table.txt ./ROIextraction_info/mean_FA_skeleton.nii.gz ./ROIextraction_info/JHU-WhiteMatter-labels-1mm.nii.gz ${dirO1}/subject${subj}_ROIout ./FA_individ/subject${subj}/stats/subject${subj}_masked_FAskel.nii.gz
done
运行该脚本,将得到89个subject*_ROIout.csv文件,并存放在ENIGMA_ROI_part1文件夹内。
3 新建一个文件并命名为run_ROI_part2.sh,代码如下
mkdir ENIGMA_ROI_part2
dirO1=./ENIGMA_ROI_part1/
dirO2=./ENIGMA_ROI_part2/
# you may want to automatically create a subjectList file
# in which case delete the old one
# and ‘echo‘ the output files into a new name
rm ./subjectList.csv
for subj in {1..87}
do
./ROIextraction_info/averageSubjectTracts_exe ${dirO1}/subject${subj}_ROIout.csv ${dirO2}/subject${subj}_ROIout_avg.csv
# can create subject list here for part 3!
echo ${subject},${dirO2}/${subject}_ROIout_avg.csv >> ./subjectList.csv
done
运行该脚本,将得到89个subject*_ROIout_avg.csv文件,并存放在ENIGMA_ROI_part2文件夹内。这一步主要是对有左右分区的ROI求均值。
此时,run_tbss文件夹的内容如下:
4 将所有病人的ROI信息整合到一个csv文件中
(1)安装R包:Download and install ‘R’ http://cran.r-project.org/
(2)新建一个文件并命名为ALL_Subject_Info.txt,该文件主要记录了病人的相关信息,ROIextraction_info文件夹内提供了示例:
(3)新建一个文件并命名为run_ROI_part3.sh,代码如下
####### ## part 3 - combine all ####### Table=./ALL_Subject_Info.txt subjectIDcol=subjectID subjectList=./subjectList.csv outTable=./combinedROItable.csv Ncov=2 covariates="Age;Sex" Nroi="all" #2 rois="IC;EC" #location of R binary Rbin=/usr/bin/R #Run the R code ${Rbin} --no-save --slave --args ${Table} ${subjectIDcol} ${subjectList} ${outTable} ${Ncov} ${covariates} ${Nroi} ${rois} < ./combine_subject_tables.R
将ROIextraction_info文件夹中的ALL_Subject_Info.txt, subjectList.csv, combine_subject_tables.R移动到与ENIGMA_ROI_part2同一目录下,并执行该脚本,输出结果见ENIGMA DTI Protocol之详细步骤一。
标签:
原文地址:http://www.cnblogs.com/happygirl-zjj/p/5103088.html