Modify transformation matrix in Elekta FIF recordings

Dear François,
Following our last exchanges, we could modify a fif file (from an adult MEG recording) and integrate in this fif file the transformation matrix corresponding to the baby head position (we don't have access to the fif file of the baby head recording). Headshape points and anatomical landmarks points from adult MEG recording were not replaced. We have imported this modified fif file in brainstorm as well as the baby headmodel. As I understand what is done during the import process, brainstorm read this transformation matrix in the fif file by importing our modified fif file, we obtain the baby headmodel in the real baby head position. Do you confirm this ? Below is a screen shot of the result after fif file import:

screenshot_babyhead210602b

Hi Etienne,

I'm sorry, I don't know what you can expect from file you modified manually...

François

What we are expecting by importing this modified fif file (but maybe we're wrong) is to get the real baby head position in the helmet. If Brainstorm well reads the transformation matrix from the fif file during the import process to fit the head position in the MEG helmet, we hope by importing this modified fif file, that Brainstorm will display the baby head in the real position that has been included in the fif file.
We also have the coordinates of the anatomical landmarks and therefore, if it is possible to enter manually these coordinates in brainstorm, we should do it. But it is not possible (no existing tools for that) to modify these coordinates in the fif file.
Many thanks for your help François !

Modifying a FIF file would be easier from MNE-Python, as you can load the file as an object, modify any value, and save it as a new FIF file.

Brainstorm can't modify FIF files, I guess the only the thing you could do is alter the reading function, or debug it line by line and replace the values immediately after they are read.

Dear François,
we didn't use Brainstorm for modifying the fif file. We did that with a dedicated tool from MEGIN. This MEGIN tool only allow changing the transformation matrix, not the landmarks coordinates or the headshape points coordinates,
And we have only imported this modified fif file in Brainstorm afterwards. It is why I would like to check with you if during this import process, Brainstorm well read the new transformation matrix for positionning the head inside the helmet.
I didn't know that it was possible to change any value in a fif file with MNE. We will also try this.
Best regards
Etienne

I can't tell you how Brainstorm would behave with your manually modified FIF files, it depends how the information is saved in them.
The best is that you debug line by line what the reading function does:


(I moved your question to a new topic, as it was unrelated to the infant atlases)

Dear François,
Many thanks for your help !
Best regards
Etienne