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.
is this for the head origin? (defined in the head coordinate system)
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”.
thanks!
This is an old function with a docstring that is not precise/up-to-date.
If you look at the code: mne-python/mne/chpi.py 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.