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