mne.preprocessing.annotate_movement#

mne.preprocessing.annotate_movement(raw, pos, rotation_velocity_limit=None, translation_velocity_limit=None, mean_distance_limit=None, use_dev_head_trans='average')[source]#

Detect segments with movement.

Detects segments periods further from rotation_velocity_limit, translation_velocity_limit and mean_distance_limit. It returns an annotation with the bad segments.

Parameters
rawinstance of Raw

Data to compute head position.

posarray, shape (N, 10)

The position and quaternion parameters from cHPI fitting. Obtained with mne.chpi functions.

rotation_velocity_limitfloat

Head rotation velocity limit in radians per second.

translation_velocity_limitfloat

Head translation velocity limit in radians per second.

mean_distance_limitfloat

Head position limit from mean recording in meters.

use_dev_head_trans‘average’ (default) | ‘info’

Identify the device to head transform used to define the fixed HPI locations for computing moving distances. If average the average device to head transform is computed using compute_average_dev_head_t. If info, raw.info['dev_head_t'] is used.

Returns
annotmne.Annotations

Periods with head motion.

hpi_disparray

Head position over time with respect to the mean head pos.

Examples using mne.preprocessing.annotate_movement#

Extracting and visualizing subject head movement

Extracting and visualizing subject head movement

Extracting and visualizing subject head movement
Annotate movement artifacts and reestimate dev_head_t

Annotate movement artifacts and reestimate dev_head_t

Annotate movement artifacts and reestimate dev_head_t