Skip to content

Using these plugins from the command line

The three plugins take the same parameters — only the --run name and, for EEG/sEEG, the extra PSD band parameters, differ. None of them currently support --use_markers/--skip_markers to restrict the analyzed portion of the file: the whole recording is always analyzed.

option type description/value
--run "MEG Artifact Detector" / "EEG Artifact Detector" / "SEEG Artifact Detector" MANDATORY name of the plugin (quote it — the name contains spaces)
--window_length_s value optional (default 5.0) analysis window length, in seconds
--zscore_threshold value optional (default 5.0) robust z-score threshold for criteria 1/2/5
--global_bad_ratio value optional (default 0.8) fraction of flagged windows above which a channel is treated as persistently bad
--neighbor_count value optional (default 5, sEEG: 2) number of neighbors used by criteria 2/3
--psd_pair_zscore_threshold value optional (default 3.0) robust z-score threshold, criterion 3
--psd_peak_zscore_threshold value optional (default 3.0) robust z-score threshold, criterion 4
--psd_band_low_hz / --psd_band_high_hz value optional, EEG/sEEG only (default 20/70) criterion 3 broadband range, in Hz
--psd_peak_low_hz / --psd_peak_high_hz value optional, EEG/sEEG only (default 2/100) criterion 4 peak-search range, in Hz

See the shared methodology page for what each parameter actually controls.

This plugin also supports the following common options:

option type
--input_file MANDATORY
--output_dir optional
--output_file optional

--skip_bad_channels does not apply here

A plain --run invocation builds its channel list from the file's default montage, which already excludes any channel listed in its .bad sidecar, regardless of --skip_bad_channels (that option only affects a few other command-line code paths, not a plain --run). To review channels that are already marked bad, run against a copy of the file without its .bad sidecar.

Output

Each run writes one .mrk file to --output_dir (defaults to the input file's own directory) containing the transient (criterion 5) markers, labeled "artifact". Channels flagged by any criterion are colored red directly in the montage when run from the GUI; from the command line there is no view to color, so check the log for the list of flagged channels instead.

Default output file name, if --output_file isn't given: <input file base name>_megartifact.mrk / _eegartifact.mrk / _seegartifact.mrk.

Examples

MEG, default parameters

anywave --run "MEG Artifact Detector" --input_file d:\data\myfile.meg4

EEG, custom analysis window and threshold

anywave --run "EEG Artifact Detector" --input_file d:\data\myfile.edf --window_length_s 4 --zscore_threshold 4.5

sEEG, custom output location

anywave --run "SEEG Artifact Detector" --input_file d:\data\myfile.trc --output_dir d:\results --output_file myfile_seeg_review.mrk