braindecode.preprocessing.AnnotateMovement#

class braindecode.preprocessing.AnnotateMovement(pos, rotation_velocity_limit=None, translation_velocity_limit=None, mean_distance_limit=None, use_dev_head_trans='average')[source]#

Braindecode preprocessor wrapper for annotate_movement().

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 degrees per second.

translation_velocity_limitfloat

Head translation velocity limit in meters 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.

See also

compute_average_dev_head_t

Methods

fn(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:
  • raw (instance of Raw) – Data to compute head position.

  • pos (array, shape (N, 10)) – The position and quaternion parameters from cHPI fitting. Obtained with mne.chpi functions.

  • rotation_velocity_limit (float) – Head rotation velocity limit in degrees per second.

  • translation_velocity_limit (float) – Head translation velocity limit in meters per second.

  • mean_distance_limit (float) – 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:

  • annot (mne.Annotations) – Periods with head motion.

  • hpi_disp (array) – Head position over time with respect to the mean head pos.

See also

compute_average_dev_head_t