Dear FSL experts,
I want to perform some fMRI analysis of a large number of fMRI datasets through bash scripts. There seems to be several introductions on how to analyze fMRI data through the FSL gui but I can't find any template bash script.
I have started on a bash script for single subject fMRI analysis (the produced results will later be used in another script for multi subject analysis) but I have several questions;
Is it easier to setup an fsf-file and simply run feat ?
Should I perform motion correction before registering the EPI data to the T1 volume?
How do I perform registration between EPI and the T1 volume?
How do I add estimated motion parameters as additional regressors? Concat the motion parameters to design.mat?
How does the prewhitening with film_gls interact with fsl_glm ?
Is there an easy way to create a brain mask for the EPI data?
-----------------------
# Segment the brain from the T1 volume
bet T1.nii.gz T1_brain.nii.gz
# Do registration between brain T1 and brain MNI
flirt -ref ${MNI_TEMPLATE} -in T1_brain.nii.gz -omat anat_2_mni_xform.mat
# Motion correction
mcflirt -in fMRI.nii.gz -plots
# Do registration between EPI and T1
flirt -ref T1.nii.gz -in ??? -omat epi_2_anat_xform.mat
# Create total transformation matrix between MNI and EPI
convert_xfm -omat mni_2_epi_xform.mat -concat anat_2_epi_xform.mat mni_2_anat_xform.mat
# Create total transformation matrix between EPI and MNI
convert_xfm -omat epi_2_mni_xform.mat -inverse mni_2_epi_xform.mat
# Transform MNI mask to EPI space
flirt -in ${MNI_MASK} -ref ???
# Perform smoothing of motion corrected volumes
fslmaths fMRI_mfc.nii.gz -kernel gauss 8 fMRI_mfc_s.nii.gz
# Perform prewhitening
film_gls -sa ???
# Perform GLM analysis
fsl_glm -i fMRI_mfc_s.nii.gz -d design.mat -o betas.nii.gz -c model.con -m ${EPI_MASK}
# Transform beta volume to MNI
flirt -in betas.nii.gz -ref ${MNI_TEMPLATE} -applyxfm -init epi_2_mni_xform.mat -out betas_mni.nii.gz
Regards,
Anders
|