Skip to content

Commit

Permalink
Merge pull request #3 from switt4/pepolar2
Browse files Browse the repository at this point in the history
Add call to correctFieldMapCase4 to tar2bids
  • Loading branch information
switt4 authored May 17, 2023
2 parents daf3e3a + 7b77c89 commit eefd5d0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Empty file modified etc/correctFieldMapCase4
100644 → 100755
Empty file.
Empty file modified etc/correctFieldMapJsonCase4.py
100644 → 100755
Empty file.
15 changes: 15 additions & 0 deletions tar2bids
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ then
#check if certain files exist that need further corrections: (the following simply suppresses stderr: 1>/dev/null 2>&1)
Nfmaps=`ls $output_dir/sub-*/ses-*/fmap/*phasediff.nii.gz 2>/dev/null | wc -l`
NfmapsCase2=`ls $output_dir/sub-*/ses-*/fmap/*twomagphase1.nii.gz 2>/dev/null | wc -l`
NfmapsCase4=`ls $output_dir/sub-*/ses-*/fmap/*epi.nii.gz 2>/dev/null | wc -l`
Ngre=`ls $output_dir/sub-*/ses-*/anat/*GRE?.nii.gz 2>/dev/null | wc -l`
Nbold=`ls $output_dir/sub-*/ses-*/func/*bold?.nii.gz 2>/dev/null | wc -l`
Nmemp2rage=`ls $output_dir/sub-*/ses-*/anat/*MP2RAGE?.nii.gz 2>/dev/null | wc -l`
Expand All @@ -342,6 +343,7 @@ else
#check if certain files exist that need further corrections: (the following simply suppresses stderr: 1>/dev/null 2>&1)
Nfmaps=`ls $output_dir/sub-*/fmap/*phasediff.nii.gz 2>/dev/null | wc -l`
NfmapsCase2=`ls $output_dir/sub-*/fmap/*twomagphase1.nii.gz 2>/dev/null | wc -l`
NfmapsCase4=`ls $output_dir/sub-*/fmap/*epi.nii.gz 2>/dev/null | wc -l`
Ngre=`ls $output_dir/sub-*/anat/*GRE?.nii.gz 2>/dev/null | wc -l`
Nbold=`ls $output_dir/sub-*/func/*bold?.nii.gz 2>/dev/null | wc -l`
Nmemp2rage=`ls $output_dir/sub-*/anat/*MP2RAGE?.nii.gz 2>/dev/null | wc -l`
Expand Down Expand Up @@ -382,6 +384,19 @@ fi
fi


if [ ! "$NfmapsCase4" = 0 ]
then
echo " Running bids correction from phasediff fieldmap data..."

if [ -n "$sessid" ]
then
parallel -a $heudiconv_subjlist -a $heudiconv_sesslist $popts "$execpath/etc/correctFieldMapCase4 $output_dir {1} {2} | tee -a $tuneup_log.{1}.{2} "
else
parallel -a $heudiconv_subjlist $popts "$execpath/etc/correctFieldMapCase4 $output_dir {1} | tee -a $tuneup_log.{1}"
fi

fi


if [ ! "$Ngre" = 0 -o ! "$Nmemp2rage" = 0 -o ! "$Nsa2rage_complex" = 0 -o ! "$Nmemprage" = 0 ]
then
Expand Down

0 comments on commit eefd5d0

Please sign in to comment.