Dear experts in the FSL community,
Have a nice day!
Now I have 80 subjects and four task-based fMRI scans and a resting-state fMRI scan.
I found it's time-consuming and typing errors sometimes when I input information using GUI in FSL. So I tried to write a batch for this kind of tedious work. However, I still can not successfully replace the markers (directory of OUTPUT file, anatomical, and functional data) in the template.fsf and I can not figure out what's the problem.
PS: I am a medical student and have a limited knowledge of computer science, so I roughly read some articles about the 'sed' command, but I do not think I have got it fully, already. Forgive me, please.
Any suggestions will be highly appreciated.
Thank you very much.
Here is my batch (the template.fsf is from another subject's feat results, I copy it and renamed it 'template.fsf').
#!/bin/bash
FSLDIR=/usr/local/fsl
. ${FSLDIR}/etc/fslconf/fsl.sh
PATH=${FSLDIR}/bin:${PATH}
export FSLDIR PATH
dir=$( pwd )
SUBJ="G1_AG_1446"
for run in $SUBJ
do
echo "precossing"
##current subject directory
SUBJ=$dir/$run
OUTPUT=${SUBJ}/1st_oput
DATA=${SUBJ}/funct/epi.nii.gz
ANAT=${SUBJ}/anat/anat_brain.nii.gz
echo $OUTPUT
##makes the fsf files from the template fsf file
for i in 'template.fsf'; do
sed -e 's@OUTPUT@'$OUTPUT'@g' \
-e 's@ANAT@'$ANAT'@g' \
-e 's@DATA@'$DATA'@g' <$i> ${SUBJ}/feat_01.fsf
done
echo "finish"
#runs the analysis using the newly created fsf file
feat $dir/$run/feat_01.fsf
done
Best Regards,
----------------------------------
Shun Yao
Ph.D. student
Brigham and Women's Hospital
Harvard Medical School
Boston, MA, 02115, U.S.
Email:[log in to unmask]
########################################################################
To unsubscribe from the FSL list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1
|