Skip to content

Commit

Permalink
BUG: VAR=0; ((VAR++)) fails on Linux but not on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpa committed Jul 23, 2024
1 parent d368e3d commit d88f932
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Scripts/antsMultivariateTemplateConstruction2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ COUNT=0
for (( g = $WHICHMODALITY; g < ${#IMAGESETARRAY[@]}; g+=$NUMBEROFMODALITIES ))
do
CURRENTIMAGESET[$COUNT]=${IMAGESETARRAY[$g]}
(( COUNT++ ))
COUNT=$(( COUNT + 1 ))
done
}

Expand Down Expand Up @@ -917,7 +917,7 @@ elif [[ ${NINFILES} -eq 1 ]];
for (( i = 0; i < ${#files[@]}; i++ ));
do
IMAGESETARRAY[$IMAGECOUNT]=${files[$i]}
((IMAGECOUNT++))
IMAGECOUNT=$(( IMAGECOUNT + 1 ))
done
done < $IMAGESFILE
else
Expand Down Expand Up @@ -999,7 +999,7 @@ elif [[ ${NINFILES} -eq 1 ]];
ImageMath $TDIM selection/vol0${number}.nii.gz ExtractSlice ${IMAGESETVARIABLE} ${number}
# cp vol0${number}.nii.gz selection/
fi
((j++))
j=$(( j + 1 ))
done
fi
elif [[ ${range} -gt ${nfmribins} && ${range} -lt 32 ]];
Expand Down Expand Up @@ -1224,7 +1224,7 @@ if [[ "$RIGID" -eq 1 ]];
# execute jobs in series
bash $qscript
fi
((count++))
count=$(( count + 1 ))
done
if [[ $DOQSUB -eq 1 ]];
then
Expand Down Expand Up @@ -1756,7 +1756,7 @@ while [[ $i -lt ${ITERATIONLIMIT} ]];
rm -f ${outdir}/job*.txt ${outdir}/slurm-*.out
fi
echo "Iteration $itdisplay completed"
((i++))
i=$(( i + 1 ))
done

# end main loop
Expand Down

0 comments on commit d88f932

Please sign in to comment.