[Mne_analysis] Automatic artifact rejection on continuous data

Mikołaj Magnuski mmagnuski at swps.edu.pl
Wed Jul 27 10:28:41 EDT 2016
Search archives:

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.
>
>

-- 

------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160727/7f5a0ad7/attachment-0001.html 


More information about the Mne_analysis mailing list