mne_nirs.preprocessing.detect_motion_artifacts#
- mne_nirs.preprocessing.detect_motion_artifacts(raw, t_motion=0.5, t_mask=1.0, stdev_thresh=50.0, amp_thresh=5.0, *, verbose=None)[source]#
Detect motion artifacts in fNIRS data.
A sample is flagged when, within the following
t_motionseconds, the signal changes by more thanstdev_threshtimes the standard deviation of its first derivative or by more thanamp_thresh. Flagged samples are padded byt_maskseconds on each side. The channels of a source-detector pair are evaluated together and share one mask. This is a port of Homer3’shmrR_MotionArtifactByChannel[1] and gives identical masks.- Parameters:
- rawinstance of
Raw The raw fNIRS data (optical density or hemoglobin).
- t_motion
float Duration (s) of the window over which changes are evaluated.
- t_mask
float Duration (s) to pad around each flagged sample.
- stdev_thresh
float Threshold as a multiple of the standard deviation of the first derivative.
- amp_thresh
float Absolute threshold on the amplitude change.
- verbosebool |
str|int|None Control verbosity of the logging output. If
None, use the default verbosity level. See the logging documentation andmne.verbose()for details. Should only be passed as a keyword argument.
- rawinstance of
- Returns:
Notes
The default thresholds are those of Homer3. Suitable values depend on the sampling rate and the units of the data.
References