<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important">Just adding to Jean-Remi’s answer:<br>you can quickly and easily chop data into segments using <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">_segment_raw</code>:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="hljs language-python" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248);white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248)"><span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">from</span> mne.epochs <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">import</span> _segment_raw
epochs = _segment_raw(raw_eeg, segment_length=<span class="hljs-number" style="color:rgb(0,128,128)">2.</span>)
</code></pre>
<p style="margin:0px 0px 1.2em!important">This chops the data into 2-s long segments.</p>
<div title="MDH:SnVzdCBhZGRpbmcgdG8gSmVhbi1SZW1pJ3MgYW5zd2VyOjxkaXY+eW91IGNhbiBxdWlja2x5IGFu
ZCBlYXNpbHkgY2hvcCBkYXRhIGludG8gc2VnbWVudHMgdXNpbmcgYF9zZWdtZW50X3Jhd2A6PC9k
aXY+PGRpdj5gYGBweXRob248L2Rpdj48ZGl2PmZyb20gbW5lLmVwb2NocyBpbXBvcnQgX3NlZ21l
bnRfcmF3PC9kaXY+PGRpdj5lcG9jaHMgPSBfc2VnbWVudF9yYXcocmF3X2VlZywgc2VnbWVudF9s
ZW5ndGg9Mi4pPC9kaXY+PGRpdj5gYGA8L2Rpdj48ZGl2PlRoaXMgY2hvcHMgdGhlIGRhdGEgaW50
byAyLXMgbG9uZyBzZWdtZW50cy48L2Rpdj4=" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0">​</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-07-25 15:30 GMT+02:00 JR KING <span dir="ltr">&lt;<a href="mailto:jeanremi.king@gmail.com" target="_blank">jeanremi.king@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi Nico,<br><br></div>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. <br><br>chunk_size = 1000<br>chunk_starts = np.arange(0, raw.n_times, chunk_size)<br>events = np.c_[chunk_starts, np.zeros((len(chunk_starts), 2))].astype(int)<br>epochs = mne.Epochs(raw, events, dict(chunk=0), tmin=0, tmax=chunk_size * <a href="http://raw.info" target="_blank">raw.info</a>[&#39;sfreq&#39;], reject=dict(mag=5e-12))<br><br></div><div>Don&#39;t forget to check out the artefact correction tutorial:<br><a href="http://martinos.org/mne/stable/auto_tutorials/plot_artifacts_detection.htm" target="_blank">http://martinos.org/mne/stable/auto_tutorials/plot_artifacts_detection.htm</a><br><br></div><div>the gallery examples:<br><a href="http://martinos.org/mne/stable/auto_examples/preprocessing/plot_find_eog_artifacts.html" target="_blank">http://martinos.org/mne/stable/auto_examples/preprocessing/plot_find_eog_artifacts.html</a><br><a href="http://martinos.org/mne/stable/auto_examples/preprocessing/plot_find_ecg_artifacts.html" target="_blank">http://martinos.org/mne/stable/auto_examples/preprocessing/plot_find_ecg_artifacts.html</a><br><a href="http://martinos.org/mne/stable/auto_examples/preprocessing/plot_interpolate_bad_channels.html" target="_blank">http://martinos.org/mne/stable/auto_examples/preprocessing/plot_interpolate_bad_channels.html</a><br><br></div><div>as well as Jas&#39; autoreject repository:<br><a href="https://github.com/jasmainak/autoreject" target="_blank">https://github.com/jasmainak/autoreject</a><br><br></div><div>Hope that helps,<br><br></div><div>Jean-Rémi<br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 25 July 2016 at 08:44, Nico Adelhöfer <span dir="ltr">&lt;<a href="mailto:nico.adelhoefer@st.ovgu.de" target="_blank">nico.adelhoefer@st.ovgu.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is there a way to set parameters for automatic artifact rejection on<br>
continuous data in MNE? I&#39;m especially interested in setting<br>
parameters such as &quot;maximum allowed voltage step&quot; or &quot;maximum and<br>
minimum amplitude&quot;. Is there a command that achieves this on raw data?<br>
<br>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" target="_blank">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
<br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
<br></blockquote></div><br></div>

<br>
<hr>