Skip to content

Commit

Permalink
Merge pull request #658 from gdevenyi/fix-greedy-extension-stripping
Browse files Browse the repository at this point in the history
Use pattern matching to remove extensions instead of greedy parameter expansion
  • Loading branch information
ntustison authored Nov 4, 2018
2 parents 23e88fe + 4c50d86 commit 412bb8f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Scripts/antsMultivariateTemplateConstruction2.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

shopt -s extglob

VERSION="0.0.0"

# trap keyboard interrupt (control-c)
Expand Down Expand Up @@ -1322,12 +1324,12 @@ while [[ $i -lt ${ITERATIONLIMIT} ]];
indir=`pwd`
fi
IMGbase=`basename ${IMAGESETARRAY[$l]}`
OUTFN=${OUTPUTNAME}template${k}${IMGbase%%.*}
OUTFN=${OUTPUTNAME}template${k}${IMGbase/%?(.nii.gz|.nii)}
OUTFN=`basename ${OUTFN}`
DEFORMED="${outdir}/${OUTFN}${l}WarpedToTemplate.nii.gz"

IMGbase=`basename ${IMAGESETARRAY[$j]}`
OUTWARPFN=${OUTPUTNAME}${IMGbase%%.*}
OUTWARPFN=${OUTPUTNAME}${IMGbase/%?(.nii.gz|.nii)}
OUTWARPFN=`basename ${OUTWARPFN}`
OUTWARPFN="${OUTWARPFN}${j}"

Expand Down Expand Up @@ -1360,7 +1362,7 @@ while [[ $i -lt ${ITERATIONLIMIT} ]];
done

IMGbase=`basename ${IMAGESETARRAY[$j]}`
OUTWARPFN=${OUTPUTNAME}${IMGbase%%.*}
OUTWARPFN=${OUTPUTNAME}${IMGbase/%?(.nii.gz|.nii)}
OUTWARPFN=`basename ${OUTWARPFN}${j}`

stage0="-r [${TEMPLATES[0]},${IMAGESETARRAY[$j]},1]"
Expand Down

0 comments on commit 412bb8f

Please sign in to comment.