mne.get_chpi_positions(raw, t_step=None, return_quat=False, verbose=None)

Extract head positions

Note that the raw instance must have CHPI channels recorded.


raw : instance of Raw | str

Raw instance to extract the head positions from. Can also be a path to a Maxfilter log file (str).

t_step : float | None

Sampling interval to use when converting data. If None, it will be automatically determined. By default, a sampling interval of 1 second is used if processing a raw data. If processing a Maxfilter log file, this must be None because the log file itself will determine the sampling interval.

return_quat : bool

If True, also return the quaternions.

New in version 0.11.

verbose : bool, str, int, or None

If not None, override default verbose level (see mne.verbose).


translation : ndarray, shape (N, 3)

Translations at each time point.

rotation : ndarray, shape (N, 3, 3)

Rotations at each time point.

t : ndarray, shape (N,)

The time points.

quat : ndarray, shape (N, 3)

The quaternions. Only returned if return_quat is True.


The digitized HPI head frame y is related to the frame position X as:

Y =, X) + translation

Note that if a Maxfilter log file is being processed, the start time may not use the same reference point as the rest of mne-python (i.e., it could be referenced relative to raw.first_samp or something else).