Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #336 from ariekahn/allow_res_tags
Browse files Browse the repository at this point in the history
Allow for fmriprep resolution tags
  • Loading branch information
a3sha2 committed May 22, 2020
2 parents 39127b7 + cb7f2fa commit 4693f0f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
19 changes: 17 additions & 2 deletions modules/prestats/prestats.mod
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,25 @@ while (( ${#rem} > 0 ))

routine @ getting data from fmriprep directory
exec_fsl immv ${intermediate} ${intermediate}_${cur}
imgprt=${img1[sub]%_*_*_*}; conf="_desc-confounds_regressors.tsv"

# Check if we have a res- tag
# Added by recent versions of fmriprep
imgname=$(basename ${img1[sub]})
conf="_desc-confounds_regressors.tsv"
if [[ "$imgname" == *_res-* ]]; then
imgprt=${img1[sub]%_*_*_*_*}
else
imgprt=${img1[sub]%_*_*_*}
fi
exec_sys cp ${imgprt}${conf} $out/prestats/${prefix}_fmriconf.tsv

imgprt2=${img1[sub]%_*_*}; mskpart="_desc-brain_mask.nii.gz"
mask1=${imgprt2}${mskpart}; maskpart2=${mask1#*_*_*_*}
mask1=${imgprt2}${mskpart};
if [[ "$imgname" == *_res-* ]]; then
maskpart2=${mask1#*_*_*_*_*}
else
maskpart2=${mask1#*_*_*_*}
fi
refpart="_boldref.nii.gz"; refvol=${imgprt2}${refpart}

conf2="_desc-confounds_regressors.json"
Expand Down
18 changes: 16 additions & 2 deletions modules/task/task.mod
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,24 @@ if (( ${task_fmriprep[cxt]} == 1 ))

routine @ getting data from frmiprep directory

imgprt=${img1[sub]%_*_*_*}; conf="_desc-confounds_regressors.tsv"
# Check if we have a res- tag
# Added by recent versions of fmriprep
imgname=$(basename ${img1[sub]})
conf="_desc-confounds_regressors.tsv"
if [[ "$imgname" == *_res-* ]]; then
imgprt=${img1[sub]%_*_*_*_*}
else
imgprt=${img1[sub]%_*_*_*}
fi
exec_sys cp ${imgprt}${conf} ${out}/task/${prefix}_fmriconf.tsv

imgprt2=${img1[sub]%_*_*}; mskpart="_desc-brain_mask.nii.gz"
mask1=${imgprt2}${mskpart}; maskpart2=${mask1#*_*_*_*}
mask1=${imgprt2}${mskpart};
if [[ "$imgname" == *_res-* ]]; then
maskpart2=${mask1#*_*_*_*_*}
else
maskpart2=${mask1#*_*_*_*}
fi
refpart="_boldref.nii.gz"; refvol=${imgprt2}${refpart}

output fmriprepconf ${out}/task/${prefix}_fmriconf.tsv
Expand Down

0 comments on commit 4693f0f

Please sign in to comment.