...
for fn in ${fn_list[*]}
...
Peace
Gordon
On 10/21/2010 04:02 AM, Alireza Salamy wrote:
> Hello,
>
> I hope it doesn't sound annoying but I have tried different combinations
> of your suggestion but still doesn't work. It seems initializing an
> array which contains folder's location (which is going to be used in a
> for loop later) is not an easy task. let's assume I have two folders in
> each there are three acquisition sessions of DTI (DTI1,DTI2,DTI3) data
> that I would like to concatenate.The two folders located at:
>
> /home/alireza/Desktop/DTIBetula101019/B2509.30
> /home/alireza/Desktop/DTIBetula101019/B2509.50
>
> I have tried:
>
> fn_list[1]= "/home/alireza/Desktop/DTIBetula101019/B2509.30"
> fn_list[2]= "/home/alireza/Desktop/DTIBetula101019/B2509.50"
> for fn in ${fn_list}
> do
> cd $fn
> fsl4.1-fslmerge -t big4D DTI1 DTI2 DTI3
> done
>
> This does not work perhaps due to incorrect initiation of the array,
>
> I have even tried:
>
> fn_list=
> ('/home/alireza/Desktop/DTIBetula101019/B2509.30','/home/alireza/Desktop/DTIBetula101019/B2509.50')
> for fn in ${fn_list}
> do
> cd $fn
> fsl4.1-fslmerge -t big4D DTI1 DTI2 DTI3
> done
>
> This one was even worse!
>
> Any help would be highly appreciated!
>
> /Alireza
>
>
>
> --- On *Tue, 10/19/10, Matt Glasser /<[log in to unmask]>/* wrote:
>
>
> From: Matt Glasser <[log in to unmask]>
> Subject: Re: [FSL] correct bvec
> To: [log in to unmask]
> Date: Tuesday, October 19, 2010, 8:00 PM
>
> That looks like a convolution of matlab and bash syntax. The first two
> lines could read:
>
> fn_list="/B2501.35 /B2501.45"
> for fn in ${fn_list} ; do
> cd $fn
>
> I don't really know what your file structure is, but you would need
> to do
> something with the $fn variable like CD into that folder if it is a
> folder
> or use it as a variable part of a filename "$fn"-DTI-s007
>
> Peace,
>
> Matt.
>
> -----Original Message-----
> From: FSL - FMRIB's Software Library [mailto:[log in to unmask]
> <[log in to unmask]>] On Behalf
> Of <Alireza> <Sal>
> Sent: Tuesday, October 19, 2010 11:06 AM
> To: [log in to unmask] <[log in to unmask]>
> Subject: [FSL] correct bvec
>
> Thanks a lot for your help regarding my previous post.
>
> one last question is that, as I mentioned before, I am going to
> investigate
> the effect of aging on 365 subjects , hence batching at least a part
> of the
> analysis procedure would be quite helpful. I have already wrote a
> code to
> concatenate multiple with-in-subject acquisition of DTI data. However, I
> don't know how one can extend it to such a big sample. First I made
> an array
> contains the folders (let's say 2 folder for the moment) including the
> different acquisition files (e.g. 2501.35-DTI1-s007 2501.35-DTI2-s008
> 2501.35-DTI3-s009) :
>
> fn_list= ['/B2501.35','/B2501.45']
> for fn in fn_list; do
> fsl4.1-fslmerge -t big4D 2501.35-DTI1-s007 2501.35-DTI2-s008
> 2501.35-DTI3-s009; done
>
> fsl4.1-fsl eddy-correct big4D big4D-correct 0
> fsl4.1-fslroi big4D-correct av1-corr 0 38
> fsl4.1-fslroi big4D-correct av2-corr 38 38
> fsl4.1-fslroi big4D-correct av3-corr 76 38
> fsl4.1-fslmaths av1-corr -add av2-corr -add av3-corr -div 3 data
>
> however it seems that it can not get pointed to the correct folder
> to read
> the files.I guess something is wrong within the first two lines of
> the code!
> Any help would be highly appreciated.
>
> /Alireza
>
>
|