Print

Print


Hi Eddy

On 10 Mar 2009, at 17:53, Eddy D.L. wrote:


> 1)I have a important question, in output of tbss_non_FA, I have
> All_L1.nii.gz, why it have tree volume? I use this instruction  
> sequence for
> obtain one volume:
>
> $FSLDIR/bin/fslmaths all_L1 -max 0 -Tmin -bin mean_L1_mask -odt char
> $FSLDIR/bin/fslmaths all_L1 -mas mean_L1_mask all_L1
> $FSLDIR/bin/fslmaths all_L1 -Tmean mean_L1
>
> It's a good job or no?

If you want the average of L1 on the skeleton, you need to use  
all_L1_skeletonised, NOT all_L1
This is because all_L1_skeletonised is the value of L1 projected onto  
the skeleton.
In order to calculate the mean of all_L1_skeletonised, you only need a  
single call to fslmaths:

fslmaths all_L1_skeletonised -Tmean mean_L1_skeleton

I guess your three lines above were used to exclude negative values  
from L1, that fine!


> 2)
>> fslmaths V1_subject2 -mul V1_subject1 -add V1_dot
>> fslmaths V1_dot -abs -div V1_dot V1_sign
>> fslmaths V1_subject2 -mul V1_sign V1_subject2_reoriented
>> And then add all the V1_subjectn_reoriented to get the mean
>
> Sorry, I did not understand very well: unfortunately I used usually
> mathematical steps, working directly with the images isn't easy for  
> me, can
> you explain me the mathematical concept e correlation with your  
> instructions
> please?
> There is a manual for this?
> then:who is V1_dot?
> If there is no manual, can you help me in the construction of the  
> code?

what these steps do is they take V1 from subject1 as a reference, and  
flip V1 of all subjects if their dot product with V1 from subject one  
is negative.
If you x denotes V1 from subject1, and y denotes V1 from subject2
Then what you want is:
if dot(x,y)>0 -> y=y
if dot(x,y)<0 -> y=-y

This is equivalent to multiplying y by the sign of the dot product of  
x and y.
In the three lines above, the first line calculates the dot product,  
the second line calculates the sign of the dot product, and the third  
line multiplies V1 in subject2 by the sign of the dot product.


>> fslsplit V1 V1
>> fslsplit V2 V2
>> fslsplit V3 V3
>> fslmaths L1 -mul V10000 -mul V10000 tmp1
>> fslmaths L2 -mul V20000 -mul V20000 tmp2
>> fslmaths L3 -mul V30000 -mul V30000 tmp3
>> fslmaths tmp1 -add tmp2 -add tmp3 tensor11
>

the first three lines split V1, V2, V3 into their x,y,z components.  
(e.g. V1x will be V10000)
The fourth line calculates L1*V1x*V1x
Same for the two following lines.
The last line calculates L1*V1x*V1x+L2*V2x*V2x+L3*V3x*V3x
This is the top left value of your tensor.
You can use the same steps to calculate the other values of the tensor
For example, tensor(1,2) = L1*V1x*V1y+L2*V2x*V2y+L3*V3x*V3y



> Similarly to the above.
>
> Sorry if I create you problems
>
> Thanks
>
> Eddy
>

Saad Jbabdi
Oxford University FMRIB Centre

JR Hospital, Headington, OX3 9DU, UK
+44 (0) 1865 222545  (fax 717)
www.fmrib.ox.ac.uk/~saad