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 #352 from a3sha2/master
Browse files Browse the repository at this point in the history
task update
  • Loading branch information
a3sha2 committed Jun 28, 2020
2 parents 3d217f1 + ecb3677 commit 0672464
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/flywheel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ as shown below.

The cohort file will be created base on the FMRIPREP output and/or img. The `img` is input directory for asl and structural image. The processing of ASL requires
processed anatomical image from FRMIPREP (fmriprepdir) or structural processing output (antsct). The `m0` is the M0 directory for CBF calibration if present. In the case
of task-activation analysis, `task_name` is required to be specified in the config of xcpengine gear.
of task-activation analysis, `task_name` and `seission` are required to be specified in the config of xcpengine gear.

Task-activation analysis
-----------------------------
Expand Down
27 changes: 19 additions & 8 deletions modules/task/task.mod
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ if (( ${task_fmriprep[cxt]} == 1 ))
maskpart2=${mask1#*_*_*_*}
fi
refpart="_boldref.nii.gz"; refvol=${imgprt2}${refpart}

conf2="_desc-confounds_regressors.json"
if [[ -f ${imgprt}${conf2} ]]; then
exec_sys cp ${imgprt}${conf2} $out/prestats/${prefix}_fmriconf.json
output confjson $out/prestats/${prefix}_fmriconf.json
fi

output fmriprepconf ${out}/task/${prefix}_fmriconf.tsv
output rps ${out}/task/${prefix}_motion.1D
Expand Down Expand Up @@ -438,10 +444,14 @@ if (( ${task_fmriprep[cxt]} == 1 ))
oas2mni=" $(ls -d ${XCPEDIR}/space/OASIS/OASIS_transforms/OASIS-MNI_0Warp.nii.gz)
$(ls -d ${XCPEDIR}/space/OASIS/OASIS_transforms/OASIS-MNI_1Affine.mat)"

mnitoas=$( echo ${mnitoas})
oas2mni=$(echo ${oas2mni})
mnitoas=${mnitoas// /,}
oas2mni=${oas2mni// /,}
mnitopnc=" $(ls -d ${XCPEDIR}/space/PNC/PNC_transforms/MNI-PNC_1Warp.nii.gz)
$(ls -d ${XCPEDIR}/space/PNC/PNC_transforms/MNI-PNC_0Affine.mat)"
pnc2mni=" $(ls -d ${XCPEDIR}/space/PNC/PNC_transforms/PNC-MNI_0Warp.nii.gz)
$(ls -d ${XCPEDIR}/space/PNC/PNC_transforms/PNC-MNI_1Affine.mat)"
mnitopnc=$( echo ${mnitopnc})
pnc2mni=$(echo ${pnc2mni})
mnitopnc=${mnitopnc// /,}
pnc2mni=${pnc2mni// /,}

${XCPEDIR}/utils/spaceMetadata \
-o ${spaces[sub]} \
Expand All @@ -450,10 +460,6 @@ if (( ${task_fmriprep[cxt]} == 1 ))
-x ${oas2mni} -i ${mnitoas} \
-s ${spaces[sub]} 2>/dev/null

subj2temp=" $(ls -d ${antsct[sub]}/*SubjectToTemplate1Warp.nii.gz)
$(ls -d ${antsct[sub]}/*SubjectToTemplate0GenericAffine.mat)"
temp2subj=" $(ls -d ${antsct[sub]}/*TemplateToSubject0Warp.nii.gz)
$(ls -d ${antsct[sub]}/*TemplateToSubject1GenericAffine.mat)"
mnitopnc=$( echo ${mnitopnc})
pnc2mni=$(echo ${pnc2mni})
mnitopnc=${mnitopnc// /,}
Expand Down Expand Up @@ -760,8 +766,13 @@ done
exec_xcp mbind.R -x ${confmat[cxt]} -y OPdx${dx} -o ${confmat_path}
output confmat ${prefix}_confmat.1D
ac_path=${outdir}/${prefix}_acompcor.1D
if [[ -f ${confjson[cxt]} ]]; then
exec_xcp acompcor_select.py -j ${confjson[cxt]} -c ${fmriprepconf[cxt]} \
-o ${ac_path}
else
exec_xcp generate_confmat.R -i ${fmriprepconf[cxt]} -j aCompCor -o ${ac_path}
output acp ${prefix}_acompcor.1D
fi
exec_xcp mbind.R -x ${confmat[cxt]} -y ${acp[cxt]} -o ${confmat_path}
output confmat ${prefix}_confmat.1D
elif [[ ${task_confound[cxt]} == acompcor_gsr ]] ; then
Expand Down

0 comments on commit 0672464

Please sign in to comment.