Hi Saad,

Thanks for talking a look! Line 59 is modified from the original script. It basically allowed you to run the script from outside the directory by splitting the string at the "/". Thats how I had my scripts set up..

For example: rotate_bvecs2 testdir/test.ecclog testdir/test.bvec;


To do it within a directory, line 59 does need to be altered to:  matfile=$(remove_ext $(echo ${line} | grep processing | awk '{print $2}'));

For example: rotate_bvecs2 test.ecclog test.bvec;


I have a attached a zip file with:

1. the corrected rotate_bvecs2 script
2. a text file with sample output (what the terminal prints when all goes well), as well as the command syntax
3. a working bvec file
4. a working ecclog file
5. my corrected "test_rot.bvec" file

Please let me know if this works on your end. Thanks for catching this error!


Best,

Dave Deriso


On Thu, Mar 11, 2010 at 1:48 AM, Saad Jbabdi <[log in to unmask]> wrote:
Hi Dave,
Thanks for your suggestions.
I agree with you that it is best to name the output <blah>_rot
However, your script does not work - in particular I am wondering about line 59 - what is that for? That line is causing the script to fail from my side.

So I will make the relevant changes re the ouput name, but will keep the rest as it is...

Cheers, and thanks again.
Saad


On 9 Mar 2010, at 08:54, Dave Deriso wrote:

Hello,

I'm new here. My name is Dave Deriso and I am an undergrad researcher at UCSD Psychiatry/Psychology under Dr. Martin Paulus and Dr. Ramachandran. I was following the DTI pipeline on the FSL site and everything was going well until I tried to run rotate_bvecs. For some reason, it just wouldn't work. I doubt my OS has anything to do with it, but I am using a mac air laptop running OSX Snow Leopard (10.6.2).

Anyway, I decided to go ahead and rewrite the problematic portions. The new script (attached) runs without problems. In addition, I added:

 - safety measure: make sure you are running an ecclog file instead of the ecc nifti.
- changed the output to "myBvec_rot.bvec", this basically adds a "_rot" to your existing file name. The original version simply made a backup copy of your original bvec file, and named it bvec.bvec_old. bvec_rot is better because it indicates that this file has been transformed..

Please have a look and make sure I didn't make an error somewhere!

Best,

Dave Deriso
UCSD Psychiatry
<rotate_bvecs2>

--
Saad Jbabdi
University of Oxford, FMRIB Centre

JR Hospital, Headington, OX3 9DU, UK
(+44)1865-222466  (fax 717)