Hello,
It's possible there is still a small bashism in the
randomise_parallel script - can you edit $FSLDIR/bin/
randomise_parallel and replace all instances of
#!/bin/sh
with
#!/bin/bash
and let me know if this solves your problem?
Many Regards
Matthew
> Hi,
>
> I'm having some trouble with the "randomise_parallel" script. It all
> runs fine, but at the end the script that should merge the SEED
> files is not working. I'm currently running Ubuntu 9.10, with 4
> processors, gridengine and FSL_PARALLEL = 1. The command I enter to
> the terminal is:
>
> qsub -j y -N fsl_tbss_randomise -q long.q -cwd -V -b y
> "randomise_parallel -i all_FA_skeletonised -o tbss -m
> mean_FA_skeleton_mask -d design.mat -t design.con -n 1000 --T2 -V"
>
> (-n of 1000 until I get this working properly)
>
> The contents of "tbss.defragment.e65" is:
>
> ./tbss.defragment: 15: Bad substitution
> ./tbss.defragment: 15: Bad substitution
> ./tbss.defragment: 15: Bad substitution
> ./tbss.defragment: 15: Bad substitution
> ./tbss.defragment: 15: Bad substitution
> ./tbss.defragment: 15: Bad substitution
> ./tbss.defragment: 15: Bad substitution
> ./tbss.defragment: 15: Bad substitution
> ./tbss.defragment: 15: Bad substitution
> ./tbss.defragment: 15: Bad substitution
>
>
> And the contents of tbss.defragment is bleow (I have tried changing
> the first line from /bin/sh to /bin/bash, based on something I found
> deep in the archives, and then running the script from the terminal.
> This works, except I don't get any of the *_tstat2.nii.gz
> images...). I'd appreciate it if someone can point me in the right
> direction,
> Best,
> James.
>
>
> #!/bin/sh
> echo "Merging stat images"
> for FIRSTSEED in tbss_SEED1_*_p_*.nii.gz
> tbss_SEED1_*_corrp_*.nii.gz ; do
> ADDCOMMAND=""
> ACTIVESEED=1
> if [ -e $FIRSTSEED ] ; then
> while [ $ACTIVESEED -le 9 ] ; do
> ADDCOMMAND=`echo $ADDCOMMAND -add ${FIRSTSEED/_SEED1_/_SEED$
> {ACTIVESEED}_}`
> ACTIVESEED=`expr $ACTIVESEED + 1`
> done
> ADDCOMMAND=${ADDCOMMAND#-add}
> echo $ADDCOMMAND
> $FSLDIR/bin/fslmaths $ADDCOMMAND -mul 120 -div 1072 ${FIRSTSEED/
> _SEED1/}
> fi
> done
>
> echo "Merging text files"
> for FIRSTSEED in tbss_SEED1_*perm_*.txt tbss_SEED1_*_p_*.txt
> tbss_SEED1_*_corrp_*.txt ; do
> ACTIVESEED=1
> if [ -e $FIRSTSEED ] ; then
> while [ $ACTIVESEED -le 9 ] ; do
> if [ $ACTIVESEED -eq 1 ] ; then
> cat ${FIRSTSEED/_SEED1_/_SEED${ACTIVESEED}_} >> ${FIRSTSEED/
> _SEED1/}
> else
> tail -n +2 ${FIRSTSEED/_SEED1_/_SEED${ACTIVESEED}_} >> $
> {FIRSTSEED/_SEED1/}
> fi
> ACTIVESEED=`expr $ACTIVESEED + 1`
> done
> fi
> done
>
> echo "Renaming raw stats"
> for TYPE in _ _tfce_ ; do
> for FIRSTSEED in tbss_SEED1${TYPE}tstat*.nii.gz tbss_SEED1$
> {TYPE}fstat*.nii.gz ; do
> if [ -e $FIRSTSEED ] ; then
> cp $FIRSTSEED ${FIRSTSEED/_SEED1/}
> fi
> done
> done
>
> ACTIVESEED=1
> while [ $ACTIVESEED -le 9 ] ; do
> rm -rf tbss_SEED${ACTIVESEED}*_p_*
> rm -rf tbss_SEED${ACTIVESEED}*_corrp_*
> rm -rf tbss_SEED${ACTIVESEED}*
> ACTIVESEED=`expr $ACTIVESEED + 1`
> done
>
> echo "Done"
>
|