- MNE-Python version: 0.22.0
- operating system: macOS Mojave version 10.14
Hey guys,
I want to create the diagnostics figures of the eog components, mainly follow the tutorial " Repairing artifacts with ICA". Some snips of the code are shown below:
reject = get_rejection_threshold(epochs_fake, ch_types=['mag', 'grad', 'eog'])
ica = ICA(n_components=30, random_state=98, method='picard')
ica.fit(raw_notch_filt_hp, reject=reject)
eog_indices, eog_scores = ica.find_bads_eog(raw_notch_filt, ch_name='BIO001')
ica.exclude = eog_indices
ica.plot_properties(raw_notch_filt, picks=eog_indices)
After this rejecting part, I encountered the error messages 
Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’]
Artifact detected in [2000, 4000]
** Rejecting epoch based on GRAD : [‘MEG0112’, ‘MEG0133’]**
Artifact detected in [4000, 6000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [6000, 8000]
** Rejecting epoch based on GRAD : [‘MEG1342’, ‘MEG2422’]**
Artifact detected in [12000, 14000]
** Rejecting epoch based on MAG : [‘MEG0121’, ‘MEG1421’]**
Artifact detected in [20000, 22000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0141’, ‘MEG1541’]**
Artifact detected in [28000, 30000]
** Rejecting epoch based on GRAD : [‘MEG1643’, ‘MEG1933’]**
Artifact detected in [32000, 34000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG1411’]**
Artifact detected in [38000, 40000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’]**
Artifact detected in [40000, 42000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG1421’]**
Artifact detected in [42000, 44000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG1411’, ‘MEG2641’]**
Artifact detected in [46000, 48000]
** Rejecting epoch based on GRAD : [‘MEG1733’, ‘MEG1933’]**
Artifact detected in [48000, 50000]
** Rejecting epoch based on GRAD : [‘MEG1933’]**
Artifact detected in [54000, 56000]
** Rejecting epoch based on GRAD : [‘MEG1933’]**
Artifact detected in [64000, 66000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG1421’]**
Artifact detected in [66000, 68000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG1411’, ‘MEG1421’]**
Artifact detected in [70000, 72000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [72000, 74000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG1421’]**
Artifact detected in [74000, 76000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [76000, 78000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG0141’, ‘MEG1421’, ‘MEG1431’, ‘MEG2621’]**
Artifact detected in [78000, 80000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0141’, ‘MEG1421’, ‘MEG1431’, ‘MEG1541’, ‘MEG2621’, ‘MEG2631’]**
Artifact detected in [80000, 82000]
** Rejecting epoch based on MAG : [‘MEG1411’]**
Artifact detected in [92000, 94000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [96000, 98000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG1411’]**
Artifact detected in [98000, 100000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG0141’, ‘MEG1421’, ‘MEG1431’, ‘MEG1511’, ‘MEG1541’]**
Artifact detected in [102000, 104000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0141’, ‘MEG1411’, ‘MEG1421’]**
Artifact detected in [104000, 106000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG1421’, ‘MEG1431’]**
Artifact detected in [106000, 108000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG0141’, ‘MEG1411’, ‘MEG1421’, ‘MEG1431’, ‘MEG1441’, ‘MEG1511’]**
Artifact detected in [112000, 114000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG0141’, ‘MEG0211’, ‘MEG0311’, ‘MEG0341’, ‘MEG1411’, ‘MEG1421’, ‘MEG1431’, ‘MEG1441’, ‘MEG1511’, ‘MEG1541’, ‘MEG2611’, ‘MEG2621’, ‘MEG2631’, ‘MEG2641’]**
Artifact detected in [114000, 116000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG1421’]**
Artifact detected in [118000, 120000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG0141’, ‘MEG0211’, ‘MEG0241’, ‘MEG1411’, ‘MEG1421’, ‘MEG1431’, ‘MEG1441’, ‘MEG1511’, ‘MEG1521’, ‘MEG1541’, ‘MEG1611’]**
Artifact detected in [120000, 122000]
** Rejecting epoch based on MAG : [‘MEG1411’]**
Artifact detected in [124000, 126000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [130000, 132000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG1411’, ‘MEG1421’, ‘MEG1441’]**
Artifact detected in [136000, 138000]
** Rejecting epoch based on MAG : [‘MEG0131’]**
Artifact detected in [138000, 140000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG1421’]**
Artifact detected in [140000, 142000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG1411’, ‘MEG1421’]**
Artifact detected in [142000, 144000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0141’, ‘MEG1541’]**
Artifact detected in [144000, 146000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [146000, 148000]
** Rejecting epoch based on GRAD : [‘MEG1933’]**
Artifact detected in [148000, 150000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG1411’, ‘MEG1421’]**
Artifact detected in [152000, 154000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [154000, 156000]
** Rejecting epoch based on GRAD : [‘MEG1733’]**
Artifact detected in [156000, 158000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG1421’]**
Artifact detected in [162000, 164000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG0141’, ‘MEG0211’, ‘MEG0241’, ‘MEG0311’, ‘MEG0341’, ‘MEG1411’, ‘MEG1421’, ‘MEG1431’, ‘MEG1511’]**
Artifact detected in [170000, 172000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG1411’, ‘MEG1421’]**
Artifact detected in [172000, 174000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [174000, 176000]
** Rejecting epoch based on GRAD : [‘MEG1332’, ‘MEG1442’, ‘MEG2613’]**
Artifact detected in [176000, 178000]
** Rejecting epoch based on GRAD : [‘MEG1733’]**
Artifact detected in [180000, 182000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG1421’, ‘MEG2641’]**
Artifact detected in [186000, 188000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG1411’, ‘MEG1421’]**
Artifact detected in [188000, 190000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG1411’, ‘MEG1421’]**
Artifact detected in [190000, 192000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG1421’]**
Artifact detected in [192000, 194000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG1411’, ‘MEG1421’, ‘MEG1441’]**
Artifact detected in [194000, 196000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG1421’]**
Artifact detected in [196000, 198000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG0141’, ‘MEG1421’, ‘MEG1431’, ‘MEG1541’, ‘MEG2621’]**
Artifact detected in [198000, 200000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’]**
Artifact detected in [204000, 206000]
** Rejecting epoch based on GRAD : [‘MEG1342’, ‘MEG2412’, ‘MEG2642’]**
Artifact detected in [208000, 210000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [210000, 212000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG1411’, ‘MEG1421’, ‘MEG1441’]**
Artifact detected in [212000, 214000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0141’, ‘MEG1411’, ‘MEG1421’, ‘MEG1431’]**
Artifact detected in [214000, 216000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0141’, ‘MEG1411’, ‘MEG1421’, ‘MEG1441’]**
Artifact detected in [216000, 218000]
** Rejecting epoch based on GRAD : [‘MEG1922’, ‘MEG1933’]**
Artifact detected in [218000, 220000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG1421’]**
Artifact detected in [220000, 222000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG0141’, ‘MEG0241’, ‘MEG0311’, ‘MEG0341’, ‘MEG1421’, ‘MEG1431’, ‘MEG1511’, ‘MEG1521’, ‘MEG2611’]**
Artifact detected in [222000, 224000]
** Rejecting epoch based on MAG : [‘MEG1331’, ‘MEG1441’, ‘MEG2611’, ‘MEG2641’]**
Artifact detected in [224000, 226000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0141’, ‘MEG1431’, ‘MEG1721’]**
Artifact detected in [228000, 230000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG1411’, ‘MEG1421’]**
Artifact detected in [246000, 248000]
** Rejecting epoch based on GRAD : [‘MEG1733’, ‘MEG2522’]**
Artifact detected in [248000, 250000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG1411’, ‘MEG1421’]**
Artifact detected in [250000, 252000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [252000, 254000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG1411’, ‘MEG1421’, ‘MEG1441’]**
Artifact detected in [256000, 258000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’]**
Artifact detected in [260000, 262000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [262000, 264000]
** Rejecting epoch based on MAG : [‘MEG0121’]**
Artifact detected in [266000, 268000]
** Rejecting epoch based on GRAD : [‘MEG1922’]**
Artifact detected in [274000, 276000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG1411’, ‘MEG1421’, ‘MEG1441’]**
Artifact detected in [276000, 278000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [280000, 282000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG1421’, ‘MEG1511’, ‘MEG1521’, ‘MEG1611’]**
Artifact detected in [282000, 284000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG1321’, ‘MEG1411’, ‘MEG1421’, ‘MEG1431’, ‘MEG1441’, ‘MEG2611’, ‘MEG2621’, ‘MEG2641’]**
Artifact detected in [286000, 288000]
** Rejecting epoch based on MAG : [‘MEG0121’]**
Artifact detected in [288000, 290000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG1411’, ‘MEG1421’]**
Artifact detected in [292000, 294000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG0211’, ‘MEG0311’, ‘MEG0341’, ‘MEG1421’, ‘MEG1431’, ‘MEG1641’, ‘MEG2611’, ‘MEG2621’, ‘MEG2641’]**
Artifact detected in [294000, 296000]
** Rejecting epoch based on MAG : [‘MEG0121’, ‘MEG0131’, ‘MEG1421’]**
Artifact detected in [296000, 298000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG1941’]**
Artifact detected in [298000, 300000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG0141’, ‘MEG0211’, ‘MEG0241’, ‘MEG0311’, ‘MEG0341’, ‘MEG1221’, ‘MEG1321’, ‘MEG1411’, ‘MEG1421’, ‘MEG1431’, ‘MEG1441’, ‘MEG1511’, ‘MEG1641’]**
Artifact detected in [300000, 302000]
** Rejecting epoch based on GRAD : [‘MEG1732’]**
Artifact detected in [302000, 304000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0141’, ‘MEG1421’]**
Artifact detected in [304000, 306000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’]**
Artifact detected in [306000, 308000]
** Rejecting epoch based on MAG : [‘MEG0121’]**
Artifact detected in [308000, 310000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG0141’, ‘MEG0341’, ‘MEG1411’, ‘MEG1421’, ‘MEG1441’]**
Artifact detected in [310000, 312000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG0141’, ‘MEG0211’, ‘MEG0241’, ‘MEG0311’, ‘MEG0341’, ‘MEG1421’, ‘MEG1431’, ‘MEG1441’, ‘MEG1511’, ‘MEG1521’, ‘MEG1611’, ‘MEG1631’, ‘MEG1641’, ‘MEG1721’, ‘MEG1911’, ‘MEG1941’, ‘MEG2321’, ‘MEG2431’, ‘MEG2611’, ‘MEG2621’]**
Artifact detected in [312000, 314000]
** Rejecting epoch based on GRAD : [‘MEG1513’, ‘MEG1523’, ‘MEG1713’, ‘MEG1722’, ‘MEG1723’, ‘MEG1733’, ‘MEG2613’]**
Artifact detected in [314000, 316000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [316000, 318000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [318000, 320000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0141’, ‘MEG1421’]**
Artifact detected in [320000, 322000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [322000, 324000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0141’, ‘MEG1421’]**
Artifact detected in [326000, 328000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG1421’]**
Artifact detected in [328000, 330000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG1411’, ‘MEG1441’]**
Artifact detected in [332000, 334000]
** Rejecting epoch based on MAG : [‘MEG0121’]**
Artifact detected in [334000, 336000]
** Rejecting epoch based on MAG : [‘MEG0121’]**
Artifact detected in [340000, 342000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG1421’]**
Artifact detected in [342000, 344000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [346000, 348000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0141’, ‘MEG1421’, ‘MEG1431’, ‘MEG1531’, ‘MEG1541’]**
Artifact detected in [348000, 350000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0131’, ‘MEG0141’, ‘MEG1411’, ‘MEG1421’, ‘MEG1431’, ‘MEG1441’, ‘MEG1511’, ‘MEG1531’, ‘MEG1541’, ‘MEG2621’]**
Artifact detected in [350000, 352000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG1411’, ‘MEG1421’]**
Artifact detected in [352000, 354000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG0341’, ‘MEG1421’, ‘MEG1431’]**
Artifact detected in [356000, 358000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [364000, 366000]
** Rejecting epoch based on MAG : [‘MEG0121’, ‘MEG1421’, ‘MEG1641’]**
Artifact detected in [366000, 368000]
** Rejecting epoch based on MAG : [‘MEG0111’]**
Artifact detected in [368000, 370000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’]**
Artifact detected in [372000, 374000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG0141’, ‘MEG0241’, ‘MEG1321’, ‘MEG1331’, ‘MEG1411’, ‘MEG1421’, ‘MEG1431’, ‘MEG1441’, ‘MEG1511’, ‘MEG1521’, ‘MEG1611’, ‘MEG2611’]**
Artifact detected in [374000, 376000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG0141’, ‘MEG0211’, ‘MEG0241’, ‘MEG0341’, ‘MEG1441’, ‘MEG1511’, ‘MEG1521’, ‘MEG1541’, ‘MEG1611’, ‘MEG1721’]**
Artifact detected in [376000, 378000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG1411’, ‘MEG1421’, ‘MEG1441’]**
Artifact detected in [378000, 380000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG1421’]**
Artifact detected in [382000, 384000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG1421’]**
Artifact detected in [386000, 388000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’]**
Artifact detected in [390000, 392000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0141’, ‘MEG1411’, ‘MEG1421’]**
Artifact detected in [392000, 394000]
** Rejecting epoch based on GRAD : [‘MEG1912’, ‘MEG2112’]**
Artifact detected in [394000, 396000]
** Rejecting epoch based on MAG : [‘MEG0121’]**
Artifact detected in [396000, 398000]
** Rejecting epoch based on MAG : [‘MEG0111’, ‘MEG0121’, ‘MEG0131’, ‘MEG0211’, ‘MEG0341’, ‘MEG1411’, ‘MEG1421’, ‘MEG1441’]**
Artifact detected in [404000, 406000]
** Rejecting epoch based on MAG : [‘MEG0121’, ‘MEG1421’]**
Artifact detected in [406000, 408000]
Creating RawArray with float64 data, n_channels=328, n_times=162000
** Range : 0 … 161999 = 0.000 … 161.999 secs**
Ready.
** Using multitaper spectrum estimation with 7 DPSS windows**
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-41-6853a63cf653> in <module>
----> 1 ica.plot_properties(raw_notch_filt, picks=eog_indices, verbose=True)
/anaconda3/envs/mne/lib/python3.7/site-packages/mne/preprocessing/ica.py in plot_properties(self, inst, picks, axes, dB, plot_std, topomap_args, image_args, psd_args, figsize, show, reject, reject_by_annotation, verbose)
1825 figsize=figsize, show=show, reject=reject,
1826 reject_by_annotation=reject_by_annotation,
-> 1827 verbose=verbose)
1828
1829 @copy_function_doc_to_method_doc(plot_ica_sources)
<decorator-gen-154> in plot_ica_properties(ica, inst, picks, axes, dB, plot_std, topomap_args, image_args, psd_args, figsize, show, reject, reject_by_annotation, verbose)
/anaconda3/envs/mne/lib/python3.7/site-packages/mne/viz/ica.py in plot_ica_properties(ica, inst, picks, axes, dB, plot_std, topomap_args, image_args, psd_args, figsize, show, reject, reject_by_annotation, verbose)
465 epoch_var = np.insert(arr=epoch_var,
466 obj=drop_indices_corrected,
--> 467 values=drop_var[dropped_indices],
468 axis=0)
469
IndexError: index 204 is out of bounds for axis 0 with size 204
I’m really confused about what went wrong, any suggestions?
Best
When I set the reject criteria to “reject_try = dict(grad=8e-10, mag=5e-11)”, it really worked. However, the rejection criteria I started with was obtained by the package “autorejection” which seems a solid rejection toolbox, I’m wondering if it’s appropriate to modify these rejection criteria by my own will. So what I’m gonna do with these rejection criteria in my analysis, or just don’t set the rejection criteria? 