Skip to content
Snippets Groups Projects
Commit d8eaccde authored by Sam Harrison's avatar Sam Harrison
Browse files

BUGFIX: IC order switch during `imglob`

The call to imglob seems to be altering the order of ICs. This removes the
combination of glob/imglob and replaces it with an explicit loop over ICs.
parent d38f97eb
No related branches found
No related tags found
1 merge request!5Fix ordering issues with --thr flag
......@@ -86,6 +86,9 @@ if [ "$DESIGN" != -1 ] ; then
/bin/cp $dc $OUTPUT/design.con
fi
# Key sizes
N_ICs=`$FSLDIR/bin/fslnvols $ICA_MAPS`
echo "creating common mask"
j=0
for i in $INPUTS ; do
......@@ -119,8 +122,12 @@ if [ $NAF2 -eq 1 ] ; then
j=0
for i in $INPUTS ; do
s=subject`${FSLDIR}/bin/zeropad $j 5`
ZSTATS=
for n in $(seq 1 $N_ICs); do
ZSTATS="${ZSTATS} ${OUTPUT}/MM_${s}/stats/thresh_zstat${n}"
done
echo "$FSLDIR/bin/melodic -i ${OUTPUT}/dr_stage2_${s} --ICs=${OUTPUT}/dr_stage2_${s} --mix=${OUTPUT}/tmp.txt -o ${OUTPUT}/MM_${s} --Oall --report -v --mmthresh=0" >> ${LOGDIR}/drD1
echo "$FSLDIR/bin/fslmerge -t ${OUTPUT}/MM_${s}/stats/thresh2 \`\$FSLDIR/bin/imglob ${OUTPUT}/MM_${s}/stats/thresh_zstat?.* ${OUTPUT}/MM_${s}/stats/thresh_zstat??.* ${OUTPUT}/MM_${s}/stats/thresh_zstat???.*\` ; sleep 10 ; \
echo "$FSLDIR/bin/fslmerge -t ${OUTPUT}/MM_${s}/stats/thresh2 ${ZSTATS}; sleep 10 ; \
$FSLDIR/bin/imrm \`\$FSLDIR/bin/imglob ${OUTPUT}/MM_${s}/stats/thresh_zstat*.*\` ; \
cp ${OUTPUT}/MM_${s}/stats/thresh2.nii.gz ${OUTPUT}/MM_${s}/stats/thresh2_negative.nii.gz ; \
cp ${OUTPUT}/MM_${s}/stats/thresh2.nii.gz ${OUTPUT}/MM_${s}/stats/thresh2_positive.nii.gz ; \
......@@ -137,8 +144,7 @@ fi
echo "sorting maps and running randomise"
j=0
Nics=`$FSLDIR/bin/fslnvols $ICA_MAPS`
while [ $j -lt $Nics ] ; do
while [ $j -lt $N_ICs ] ; do
jj=`$FSLDIR/bin/zeropad $j 4`
RAND=""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment