[Mne_analysis] Automatic artifact rejection on continuous data

JR KING jeanremi.king at gmail.com
Wed Jul 27 11:42:55 EDT 2016
Search archives:

FYI, currently _segment_raw is a private function (as marked by the
original '_') which is we thus do not provide support for. So beware that
it could vary across mne versions.

On 27 July 2016 at 11:36, Nico Adelhöfer <nico.adelhoefer at st.ovgu.de> wrote:

> Thanks! I got it working so far with Jean-Remi's method, but using
> _segment_raw gives me an attribute error.
>
> I read that the "reject" parameter is the peak-to-peak amplitude. Are
> there other rejection parameters such as maximum allowed voltage step,
> or lowest allowed activity?
>
>
>
>
> Quoting Mikołaj Magnuski <mmagnuski at swps.edu.pl>:
>
> > Just adding to Jean-Remi’s answer:
> > you can quickly and easily chop data into segments using _segment_raw:
> >
> > from mne.epochs import _segment_raw
> > epochs = _segment_raw(raw_eeg, segment_length=2.)
> >
> > This chops the data into 2-s long segments.
> > ​
> >
> > 2016-07-25 15:30 GMT+02:00 JR KING <jeanremi.king at gmail.com>:
> >
> >> Hi Nico,
> >>
> >> To reject chunks of continuous data, the best is probably to first chop
> it
> >> into small segments, which comes down to creating adjacent events/epoch
> and
> >> apply your favorite rejection threshold, i.e.
> >>
> >> chunk_size = 1000
> >> chunk_starts = np.arange(0, raw.n_times, chunk_size)
> >> events = np.c_[chunk_starts, np.zeros((len(chunk_starts),
> 2))].astype(int)
> >> epochs = mne.Epochs(raw, events, dict(chunk=0), tmin=0, tmax=chunk_size
> *
> >> raw.info['sfreq'], reject=dict(mag=5e-12))
> >>
> >> Don't forget to check out the artefact correction tutorial:
> >>
> http://martinos.org/mne/stable/auto_tutorials/plot_artifacts_detection.htm
> >>
> >> the gallery examples:
> >>
> >>
> http://martinos.org/mne/stable/auto_examples/preprocessing/plot_find_eog_artifacts.html
> >>
> >>
> http://martinos.org/mne/stable/auto_examples/preprocessing/plot_find_ecg_artifacts.html
> >>
> >>
> http://martinos.org/mne/stable/auto_examples/preprocessing/plot_interpolate_bad_channels.html
> >>
> >> as well as Jas' autoreject repository:
> >> https://github.com/jasmainak/autoreject
> >>
> >> Hope that helps,
> >>
> >> Jean-Rémi
> >>
> >> On 25 July 2016 at 08:44, Nico Adelhöfer <nico.adelhoefer at st.ovgu.de>
> >> wrote:
> >>
> >>> Is there a way to set parameters for automatic artifact rejection on
> >>> continuous data in MNE? I'm especially interested in setting
> >>> parameters such as "maximum allowed voltage step" or "maximum and
> >>> minimum amplitude". Is there a command that achieves this on raw data?
> >>>
> >>> _______________________________________________
> >>> Mne_analysis mailing list
> >>> Mne_analysis at nmr.mgh.harvard.edu
> >>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> >>>
> >>>
> >>> The information in this e-mail is intended only for the person to whom
> it
> >>> is
> >>> addressed. If you believe this e-mail was sent to you in error and the
> >>> e-mail
> >>> contains patient information, please contact the Partners Compliance
> >>> HelpLine at
> >>> http://www.partners.org/complianceline . If the e-mail was sent to you
> >>> in error
> >>> but does not contain patient information, please contact the sender and
> >>> properly
> >>> dispose of the e-mail.
> >>>
> >>>
> >>
> >> _______________________________________________
> >> Mne_analysis mailing list
> >> Mne_analysis at nmr.mgh.harvard.edu
> >> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> >>
> >>
> >> The information in this e-mail is intended only for the person to whom
> it
> >> is
> >> addressed. If you believe this e-mail was sent to you in error and the
> >> e-mail
> >> contains patient information, please contact the Partners Compliance
> >> HelpLine at
> >> http://www.partners.org/complianceline . If the e-mail was sent to you
> in
> >> error
> >> but does not contain patient information, please contact the sender and
> >> properly
> >> dispose of the e-mail.
> >>
> >>
> >
> > --
> >
> > ------------------------------
>
>
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160727/92861dd1/attachment.html 


More information about the Mne_analysis mailing list