Yes - it is suitable. The worst you will have to do is delete some of
Bill Gates' nasty carriage returns.
Cheers
T
On 22 Aug 2007, at 00:52, Suzanna Laycock wrote:
> Hi,
>
> A while ago a colleague wrote a short script to 'reshuffle' the
> slices within our Phillips data to put it into the FSL 4D format,
> this was done using the cygwin/windows setup. Unfortunately he's
> left and I was wondering if someone with programming knowledge
> could have a quick look and tell me if it would run on the Mac
> version of FSL, or whether it would require re writting.... I'm not
> sure how the languages compare. I currently am analysing via
> cygwin/windows but would like to change to the Mac version, I want
> to know if this script is suitable before I set about downloading
> FSL to the Mac.
>
> Thanks in advance for the advice
> Suzanna
>
> ----------
> # !/bin/bash
> #
> #
> # ./process_all.txt dir dti_fname dwi_fname n_slices n_frames
> #
> # $1: dir: full data directory
> # $2: dti_fname: Philips raw images assumes .REC extension, in $1/raw
> # $3: dwi_fname: Philips raw images assumes .REC extension, in $1/raw
> # dwi has two frames only
> # $4: number of slices
> # $5: total number of frames in dti file
> #
> # output is $3.img, $3.hdr in $1/processed
> #
>
>
> pwdor=`pwd`
>
> mkdir "$1"/processed
> cd "$1"/processed
> /bin/rm -r -f t*
>
> avwcreatehd 128 128 2 "$4" 1.75 1.75 2.0 2.0 0.0 0.0 0.0 4 ttt1
> cp ../raw/"$3".REC ttt1.img
> avwsplit ttt1
> avwcreatehd 128 128 1 2 1.75 1.75 2.0 2.0 0.0 0.0 0.0 4 ttt2
>
> slind=0
> while test $slind != 10
> do
> mkdir temp"$slind"
> cd temp"$slind"
> cp ../vol000"$slind".img "$slind".img
> cp ../ttt2.hdr "$slind".hdr
> avwsplit "$slind"
> cd ../
> slind=`echo $slind + 1 |bc`
> done
>
> while test $slind != $4
> do
> mkdir temp"$slind"
> cd temp"$slind"
> cp ../vol00"$slind".img "$slind".img
> cp ../ttt2.hdr "$slind".hdr
> avwsplit "$slind"
> cd ../
> slind=`echo $slind + 1 |bc`
> done
>
>
> frameind=0
> while test $frameind != 2
> do
> slind=0
> while test $slind != $4
> do
> cat temp"$slind"/vol000"$frameind".img >> trash_big.img
> slind=`echo $slind + 1 |bc`
> done
> frameind=`echo $frameind + 1 |bc`
> done
>
> /bin/rm -r -f temp* ttt* vol*
>
> avwcreatehd 128 128 "$5" "$4" 1.75 1.75 2.0 2.0 0.0 0.0 0.0 4 ttt1
> cp ../raw/"$2".REC ttt1.img
> avwsplit ttt1
>
> avwcreatehd 128 128 1 "$5" 1.75 1.75 2.0 2.0 0.0 0.0 0.0 4 ttt2
>
> slind=0
> while test $slind != 10
> do
> mkdir temp"$slind"
> cd temp"$slind"
> cp ../vol000"$slind".img "$slind".img
> cp ../ttt2.hdr "$slind".hdr
> avwsplit "$slind"
> cd ../
> slind=`echo $slind + 1 |bc`
> done
>
> while test $slind != $4
> do
> mkdir temp"$slind"
> cd temp"$slind"
> cp ../vol00"$slind".img "$slind".img
> cp ../ttt2.hdr "$slind".hdr
> avwsplit "$slind"
> cd ../
> slind=`echo $slind + 1 |bc`
> done
>
> framemax=`echo $5 - 1 |bc`
>
> frameind=0
> while test $frameind != 10
> do
> slind=0
> while test $slind != $4
> do
> cat temp"$slind"/vol000"$frameind".img >> trash_big.img
> slind=`echo $slind + 1 |bc`
> done
> frameind=`echo $frameind + 1 |bc`
> done
>
> while test $frameind != $framemax
> do
> slind=0
> while test $slind != $4
> do
> cat temp"$slind"/vol00"$frameind".img >> trash_big.img
> slind=`echo $slind + 1 |bc`
> done
> frameind=`echo $frameind + 1 |bc`
> done
>
>
>
>
> /bin/rm -r -f temp* ttt* vol*
>
> framemax=`echo $5 + 1 |bc`
> avwcreatehd 128 128 "$4" "$framemax" 1.75 1.75 2.0 2.0 0.0 0.0 0.0
> 4 ttt
> mv ttt.hdr trash_big.hdr
>
> eddy_correct trash_big r"$2" 0
>
> /bin/rm -r -f t*
>
> cd "$pwdor"
|