Let's say I would like to send a nifti volume file to a remote collegue. He strongly asked me to save the Talairach or MNI coordinates within the nifti header. How should I proceed?
Usually, when looking at a T1 MRI (eg T1volume.nii) that has been imported in Brainvisa, getting Talairach or MNI coordinates is all done automitically using the new Morphologist pipeline. However, this is done by our beloved Anatomist browser through TRM transformation files e.g. T1volume_TO_Talairach-MNI.trm. This file magically put our T1 volume into the Talairach or MNI referential.
What should I do to use this TRM file to save the T1 volume in a NIFTI file with proper Talairach or MNI coordinates?
I first tried the following : "AimsResample -i T1volume.nii -o T1volume_MNI.nii -m T1volume_TO_Talairach-MNI.trm"
Unfortunatly, the rotation puts the T1 volume out of the result volume.

Let us say now that the T1 volume has a volume size of 256x256x256.
I then edited the TRM file and added the value 128 to each term of the first line (i.e. half the volume size to the TRM translation vector). I updated the TRM file and re-run the AimsResample command. It worked fine. So far, so good.

Well, well, almost. When looking at the resampled T1 volume with Anatomist, the coordinates do not appear to be the true MNI coordinates. As one could have expected, the coordinates have been translated by a [128 128 128] vector probably due to my previous TRM update. How can I get rid of this 128x128x128 translation in the MNI coordinates?
In some other posts, one of our magic brainvisa/anatomist dream team suggested to edit the nifti header. So I tried it in the following way:
ipython
from soma import aims
vol_mni = aims.read("T1_volume_MNI.nii")
vol_mni.header()['transformations'][0][3] -= 128
vol_mni.header()['transformations'][0][7] -= 128
vol_mni.header()['transformations'][0][11] -= 128
aims.write(vol_mni, "T1_volume_MNI-128.nii")
I then open the T1_volume_MNI-128.nii in Anatomist.

In summary, my questions are:
1) Was my initial 128x128x128 translation a good move to get the resampled volume in the MNI referential
2) Was my a posteriori correction, i.e. updating the "transformations" parameter in the Nifti header, the right one to get true MNI coordinates ?
3) Is there a way to see a MNI volume with proper coordinates, i.e. having (0,0,0) at the MNI referential origin, by using Anatomist (and without having to load a TRM transformation file)?
I hope these questions are not too cumbersome

Francois