Dear Stephen Smith

Thank you for your clarifications.
unfortunately, I think I did not pose my question correctly.

Yes output of avscale is different from fslhd to take into account scaling.

But, it looks like avscale flipped directions of axes (see my example). I would think that direction of translation should also change, but it did not. otherwise,i cannot understand what avscale its doing. I do not understand why it flipped the axes...

The reason I asked is that I used avscale-generated translation/rotation matrix in my script and got wrong results. I traced it back to (what I think is) an inconsistency between rotation and translation as output by avscale..other explanation is that I do not understand the output of avscale at all. That is why I am asking for help on this.

Thank you again

lazar

On Dec 17, 2012 7:57 PM, "Lazar Fleysher" <[log in to unmask]> wrote:
Hello

I cannot seem to understand what avscale output should be.
The documentation of the function is rather terse.

I would think that one of the outputs of
avscale (orientation and translation matrix)
should be simialr to that of

fslhd  | grep sto_xyz

Of course, the difference is that in fslhd the orientation matrix is scaled by
the pixel size.

However, It looks to me that avscale changes the direction of axes.
This of course
is not a problem, but then, the translations have to be changed also
and it does not change that.

example:

here is the output of fslhd|grep sto_xyz voxel size is 3x3x3.75


-2.998657 0.000000 0.112186 101.292267
-0.014799 2.958933 -0.618085 -87.238136
0.088520 0.494690 3.697010 -41.763031
0.000000 0.000000 0.000000 1.000000

avscale acts on this matrix and outputs

-0.999552 0.000000 0.029916 101.292267
-0.004933 -0.986311 -0.164823 -87.238136
0.029507 -0.164897 0.985869 -41.763031
0.000000 0.000000 0.000000 1.000000

Notice that the sign of the second column is reversed, but nothing is
done to translation.
The question is that I cannot seem to understand what the output of
avscale should be.

Thank you very much for your help

Lazar