Adjusting head position

Hello François,
We’re looking at improving process_evt_detect_movement.m to work fully within Brainstorm, allowing to split a dataset based on head motion, and to adjust the head position for each segment.
I was just looking at how to do the last part. First, can you confirm that in the typical MEG transformations {Dewar=>Native, Native=>Brainstorm/CTF}, Native corresponds to the head coordinate system based on the actual head coil positions, whereas the Brainstorm/CTF is based on the anatomical landmarks? Assuming that’s the case, I can easily get a new Dewar=>Native transformation since I have the coil locations in dewar coordinates in the continuous head localization channels. I can use cs_compute for that. Then what do you think would be the best way to apply the new location? I saw channel_apply_transf, which would require computing a transformation that “undoes” the two already there, apply the new Dewar=>Native and reapply Native=>Brainstorm. Do you think that’s the best option?
Thanks!

Hi Marc,

Welcome on board!
“Dewar=>Native” is the transformation that the CTF acquisition system computes when localizing the head in the helmet (read from the .hc file): https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/io/in_fopen_ctf.m#L207

The transformations that Brainstorm computes to align the sensors later are labelled “Native=>Brainstorm/CTF”. This is the case of the CTF coils => anatomical landmarks (real nasion and ears, independent from the coils positions) transformation computed at the MNI from the .pos files.

These fields “TransfMeg” and “TransfEeg” are just logs of what happened, modifying them would not change anything directly. I’d recommend you keep all the existing transformations in these lists, and just add yours: Apply your transformation to the sensors positions and log this modification in TransfMeg and TransfEeg (using another label of your choice, referencing the process that computed it for instance).

To compute your adjustment transformation, do not use cs_convert but look for inspiration in it, based on the original NAS/LPA/RPA and the adjusted NAS/LPA/RPA computed based on the displacement information in the continuous HLU channels.

Does it make sense?
Francois

Yes that makes sense. Merci François.