mne.chpi.compute_head_pos output

Hello, I am looking at the output of “mne.chpi.compute_head_pos”.
in the documentation, I see that it is in the form of:
numpy.ndarray, shape (n_pos, 10) -
The [t, q1, q2, q3, x, y, z, gof, err, v] for each fit.

  1. is this for the head origin? (defined in the head coordinate system)
  2. what are the units of q1/2/3? x/y/z?
  3. what is v? (values in the right column)

thank you!

  • MNE version: 1.6.0
  • operating system: Windows 10

Unless I’m mistaken, it represents the device to head transformation at different time points (n_pos,) in its quaternion form instead of affine transformation.


Hi thank you. I don’t think it represents the device to head tranformation, as the function description says “Compute time-varying head positions”.

mne.chpi.compute_head_pos — MNE 1.7.0.dev158+g925f52282 documentation

This is an old function with a docstring that is not precise/up-to-date.
If you look at the code: mne-python/mne/ at main · mne-tools/mne-python · GitHub
You can convince yourself that this is not a position but a transformation very easily (look here): q1, q2, q3 are the rotations in quaternion form, x, y, z is the translation.

And it seems to be a fit from this_coil_dev_rrs, the esimated coil location at a given timepoint and hpi_dig_head_rrs, the _get_hpi_initial_fit. Thus it indicates that this is a transformation from the position at every time points towards the initial head position; as opposed to the other option, a transformation from the last known position to the next position.

So in that sense it is indeed not a device to head transformation, it’s a transformation from a given position to the initial position as measured during the initial HPI measurement.


thank you very much!