<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><p><span style="padding: 3px 10px; border-radius: 5px; color: #ffffff; font-weight: bold; display: inline-block; background-color: #ff0000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p><p></p>Hi Mainak,<div class=""><br class=""></div><div class="">thanks for the reply.</div><div class=""><br class=""></div><div class="">i am indeed not experienced in python. i mindlessly copy-pasted instructions from here:</div><div class=""><a href="http://autoreject.github.io" class="">http://autoreject.github.io</a></div><div class=""><br class=""></div><div class=""><div style="margin: 0px;" class=""><div style="margin: 0px;" class=""><!--StartFragment--><span style=" color:#859900;" class="">&gt;&gt;&gt;</span> pip install -U autoreject</div><div style="margin: 0px;" class="">Requirement already up-to-date: autoreject in ./anaconda3/lib/python3.6/site-packages (0.1)<!--EndFragment--></div></div><div style="margin: 0px;" class=""><!--EndFragment--></div></div><div class=""><br class=""><div>is this the most recent version?</div><div><br class=""></div><div>regarding your other question:</div><div><div style="margin: 0px;" class=""><!--StartFragment--><span style=" color:#859900;" class="">&gt;&gt;&gt;</span> <a href="http://epochs.info" class="">epochs.info</a>['bads'] </div><div style="margin: 0px;" class="">[]<!--EndFragment--></div><div style="margin: 0px;" class=""><br class=""></div><div style="margin: 0px;" class="">best,</div><div style="margin: 0px;" class="">nathan</div></div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">Am 10.07.2018 um 15:45 schrieb Mainak Jas &lt;<a href="mailto:mainakjas@gmail.com" class="">mainakjas@gmail.com</a>&gt;:</div><br class="Apple-interchange-newline"><div class=""><p class=""><span style="padding: 3px 10px; border-radius: 5px; color: #ffffff; font-weight: bold; display: inline-block; background-color: #ff0000;" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p><div class=""><br class="webkit-block-placeholder"></div><div dir="ltr" class=""><div class=""><div class=""><div class="">Hi Nathan,<br class=""><br class=""></div>It appears you do not have the latest version of autoreject. Could you try upgrading to the latest version from pip<br class=""></div>and trying again? Also what do you have in <a href="http://epochs.info/" class="">epochs.info</a>['bads'] before you apply autoreject?<br class=""><br class=""></div>Mainak<br class=""><div class=""><div class=""><div class=""><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Jul 10, 2018 at 5:47 AM, Nathan Weisz <span dir="ltr" class="">&lt;<a href="mailto:nathanweisz@me.com" target="_blank" class="">nathanweisz@me.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space" class=""><p class=""><span style="padding:3px 10px;border-radius:5px;color:#ffffff;font-weight:bold;display:inline-block;background-color:#ff0000" class="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p><div class=""><br class="webkit-block-placeholder"></div><div class="">Hi,</div><div class=""><br class=""></div><div class="">i am trying to explore a little the "autoreject" tools. specifically i am trying to apply following example:</div><div class=""><a href="https://autoreject.github.io/auto_examples/plot_auto_repair.html#sphx-glr-auto-examples-plot-auto-repair-py" target="_blank" class="">https://autoreject.github.io/<wbr class="">auto_examples/plot_auto_<wbr class="">repair.html#sphx-glr-auto-<wbr class="">examples-plot-auto-repair-py</a></div><div class=""><br class=""></div><div class="">to a dataset recorded in salzburg.</div><div class=""><br class=""></div><div class="">i adapted the code to chop out 2s epochs from the fif file. the rest should be the same as in the tutorial example (which works great btw). code below.</div><div class=""><br class=""></div><div class="">however i am getting an error message that is over the top of my head.</div><div class=""><div style="margin:0px" class=""><span style="color:#859900" class="">&gt;&gt;&gt;</span> <span style="color:#b58900" class="">(executing lines 34 to 36 of "&lt;tmp 1&gt;")</span></div><div style="margin:0px" class="">Running autoreject on ch_type=grad</div><div style="margin:0px" class=""><span style="color:#ff0000" class="">Traceback (most recent call last):</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">  File "&lt;tmp 1&gt;", line 36, in &lt;module&gt;</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">    ar.fit(epochs)</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">  File "/Users/b1019548/anaconda3/<wbr class="">lib/python3.6/site-packages/<wbr class="">autoreject/autoreject.py", line 878, in fit</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">    self.consensus, self.verbose)</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">  File "/Users/b1019548/anaconda3/<wbr class="">lib/python3.6/site-packages/<wbr class="">autoreject/autoreject.py", line 683, in _run_local_reject_cv</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">    local_reject.fit(epochs)</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">  File "/Users/b1019548/anaconda3/<wbr class="">lib/python3.6/site-packages/<wbr class="">autoreject/autoreject.py", line 600, in fit</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">    epochs.copy(), picks=self.picks_, verbose=self.verbose)</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">  File "/Users/b1019548/anaconda3/<wbr class="">lib/python3.6/site-packages/<wbr class="">autoreject/autoreject.py", line 367, in compute_thresholds</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">    verbose=verbose)</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">  File "/Users/b1019548/anaconda3/<wbr class="">lib/python3.6/site-packages/<wbr class="">autoreject/utils.py", line 231, in clean_by_interp</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">    interpolate_bads(inst_clean, picks=picks, reset_bads=True, mode='fast')</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">  File "/Users/b1019548/anaconda3/<wbr class="">lib/python3.6/site-packages/<wbr class="">autoreject/utils.py", line 279, in interpolate_bads</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">    _interpolate_bads_meg_fast(<wbr class="">inst, picks=meg_picks_interp, mode=mode)</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">  File "/Users/b1019548/anaconda3/<wbr class="">lib/python3.6/site-packages/<wbr class="">autoreject/utils.py", line 392, in _interpolate_bads_meg_fast</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">    assert ch_names_a == ch_names_b</span></div><div style="margin:0px" class=""><span style="color:#ff0000" class="">AssertionError</span></div></div><div class=""><br class=""></div><div class="">this is likely due to my ignorance in the proper use of autoreject. but the error message makes it difficult for me to infer what the problem might be. i would appreciate any pointers.</div><div class=""><br class=""></div><div class="">best,</div><div class="">nathan</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class="">
<div style="margin:0px" class="">import numpy as np</div><div style="margin:0px" class=""><br class=""></div><div style="margin:0px" class="">n_interpolates = np.array([1, 4, 32])</div><div style="margin:0px" class="">consensus_percs = np.linspace(0, 1.0, 11)</div><div style="margin:0px" class=""><br class=""></div><div style="margin:0px" class="">##</div><div style="margin:0px" class=""><br class=""></div><div style="margin:0px" class="">import mne  # noqa</div><div style="margin:0px" class="">from mne.utils import check_random_state  # noqa</div><div style="margin:0px" class=""><br class=""></div><div style="margin:0px" class="">from autoreject import (AutoReject, set_matplotlib_defaults)  # noqa</div><div style="margin:0px" class=""><br class=""></div><div style="margin:0px" class="">check_random_state(42)</div><div style="margin:0px" class=""><br class=""></div><div style="margin:0px" class="">data_path = '/Users/b1019548/Desktop/Data_<wbr class="">Sternberg/'</div><div style="margin:0px" class="">raw_fname = data_path + 'jens_H.fif'</div><div style="margin:0px" class="">raw = mne.io.read_raw_fif(raw_fname, preload=True)</div><div style="margin:0px" class=""><br class=""></div><div style="margin:0px" class=""><br class=""></div><div style="margin:0px" class=""><br class=""></div><div style="margin:0px" class="">events = mne.make_fixed_length_events(<wbr class="">raw, id=1, duration=2)</div><div style="margin:0px" class=""><br class=""></div><div style="margin:0px" class=""><a href="http://raw.info/" target="_blank" class="">raw.info</a>['bads'] = []</div><div style="margin:0px" class="">picks = mne.pick_types(<a href="http://raw.info/" target="_blank" class="">raw.info</a>, meg='grad', eeg=False, stim=False, eog=False, include=[], exclude=[])</div><div style="margin:0px" class=""><br class=""></div><div style="margin:0px" class=""><a href="http://raw.info/" target="_blank" class="">raw.info</a>['projs'] = list() </div><div style="margin:0px" class=""><br class=""></div><div style="margin:0px" class="">epochs = mne.Epochs(raw, events, tmin=0, tmax=2,</div><div style="margin:0px" class="">                    baseline=(None, 0), reject=None,</div><div style="margin:0px" class="">                    verbose=False, detrend=0, preload=True)</div><div style="margin:0px" class=""><br class=""></div><div style="margin:0px" class=""><br class=""></div><div style="margin:0px" class="">##</div><div style="margin:0px" class="">ar = AutoReject(n_interpolates, consensus_percs, picks=picks,</div><div style="margin:0px" class="">                thresh_method='random_search', random_state=42)</div><div style="margin:0px" class="">ar.fit(epochs)</div><div style="margin:0px" class="">epochs_clean = ar.transform(epochs)</div></blockquote></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><br class="">
<br class=""></div><br class="">______________________________<wbr class="">_________________<br class="">
Mne_analysis mailing list<br class="">
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" class="">Mne_analysis@nmr.mgh.harvard.<wbr class="">edu</a><br class="">
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank" class="">https://mail.nmr.mgh.harvard.<wbr class="">edu/mailman/listinfo/mne_<wbr class="">analysis</a><br class="">
<br class="">
<br class="">
The information in this e-mail is intended only for the person to whom it is<br class="">
addressed. If you believe this e-mail was sent to you in error and the e-mail<br class="">
contains patient information, please contact the Partners Compliance HelpLine at<br class="">
<a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank" class="">http://www.partners.org/<wbr class="">complianceline</a> . If the e-mail was sent to you in error<br class="">
but does not contain patient information, please contact the sender and properly<br class="">
dispose of the e-mail.<br class="">
<br class=""></blockquote></div><br class=""></div></div></div></div></div></div>
_______________________________________________<br class="">Mne_analysis mailing list<br class=""><a href="mailto:Mne_analysis@nmr.mgh.harvard.edu" class="">Mne_analysis@nmr.mgh.harvard.edu</a><br class="">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis<br class=""><br class=""><br class="">The information in this e-mail is intended only for the person to whom it is<br class="">addressed. If you believe this e-mail was sent to you in error and the e-mail<br class="">contains patient information, please contact the Partners Compliance HelpLine at<br class="">http://www.partners.org/complianceline . If the e-mail was sent to you in error<br class="">but does not contain patient information, please contact the sender and properly<br class="">dispose of the e-mail.<br class=""></div></blockquote></div><br class=""></div></body></html>