Hi Eddy > > this is the response that I hoped to receive,but I have some > questions: Cool, we're getting there! > 1)If I put vecreg in place of applywarp, the script give me the > components > V1, V2, V3 of the new space? > Because I thought to start with vecreg to warp single vectors (V1, > V2,V3 of > study 1;V1,V2,V3 of study 2 ...)in the new space and then calculate > a "kind > of media" to get the triad final vector V1, V2,V3. I don't fully understand the procedure that you are describing here, do you mean averaging subjects? What I meant was that you need to use bits of tbss_non_FA, but change applywarp to vecreg. tbss_non_FA does two things: 1. applies the non-linear warpfield stored in the FA directory to each subject's non-FA image 2. projects on the skeleton If you want to do just (1), that is easy, just replace applywarp with vecreg in the script, and comment out everything that follows (such as the call for tbss_merge and tbss_skeleton). Note that this will only work if you used tbss_2_reg -T If you want to project on the skeleton, you will need to edit the script a bit further, as you will need to split your vectors into x,y,z, and then project each x,y,z separately. Now, if I understand you well, you want an average V1, V2 and V3 map. In which case, all you need is step (1), but in order to average vectors across subjects, you need to make sure that all vectors (across subjects) have the same direction (e.g. you want the average of [1,0,0] and [-1,0,0] to be [1,0,0], not [0,0,0]!!). You can do that by reorienting V1 in all subjects, such that the scalar product with the first subject is positive (using many calls to fslmaths). So, for example: 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. Another possibility is to calculate the tensor for each subject individually, and then average the tensors directly by adding them and dividing by the number of subjects. > 2)Can you write an example for L1,V1 in practical way, thanks! 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 etc. > > > > Cheers, > Eddy > > > >> Hi Eddy, >> >> I see now. >> You can reconstruct a tensor from its decomposition using the >> formula: Tensor = sum( Li * Vi * Vi') >> >> This can be implemented easily using several calls to fslmaths (after >> splitting the vectors into x,y,z components using fslsplit). >> >> Note that you cannot use tbss_non_FA directly on vector images such >> as >> V1 etc. You will need to edit the tbss_non_FA script, and use vecreg >> instead of applywarp. Vecreg will apply a local rotation to the >> vectors that is induced by the warpfield. >> >> Cheers, >> Saad. > Saad Jbabdi Oxford University FMRIB Centre JR Hospital, Headington, OX3 9DU, UK +44 (0) 1865 222545 (fax 717) www.fmrib.ox.ac.uk/~saad