[Mne_analysis] Could you help me find events from ".set" file?

Brunner, Clemens (clemens.brunner@uni-graz.at) clemens.brunner at uni-graz.at
Thu May 23 07:14:53 EDT 2019
Search archives:

        External Email - Use Caution        

You are probably in a venv which still has the old version - at least the error messages point to "/anaconda3/envs/mne/lib/python3.6", which is not the env where you have matplotlib 3.1.0 (which also has Python 3.7 and not 3.6).

Clemens



> On 23.05.2019, at 13:04, Soan KIM <cheukusi.kim at gmail.com> wrote:
> 
>         External Email - Use Caution        
> 
> 
> I think mine is 3.1.0!
> 
> Requirement already satisfied: matplotlib in /anaconda3/lib/python3.7/site-packages (3.1.0)
> Requirement already satisfied: python-dateutil>=2.1 in /anaconda3/lib/python3.7/site-packages (from matplotlib) (2.7.3)
> Requirement already satisfied: kiwisolver>=1.0.1 in /anaconda3/lib/python3.7/site-packages (from matplotlib) (1.0.1)
> Requirement already satisfied: numpy>=1.11 in /anaconda3/lib/python3.7/site-packages (from matplotlib) (1.15.1)
> Requirement already satisfied: cycler>=0.10 in /anaconda3/lib/python3.7/site-packages (from matplotlib) (0.10.0)
> Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /anaconda3/lib/python3.7/site-packages (from matplotlib) (2.2.0)
> Requirement already satisfied: six>=1.5 in /anaconda3/lib/python3.7/site-packages (from python-dateutil>=2.1->matplotlib) (1.11.0)
> Requirement already satisfied: setuptools in /anaconda3/lib/python3.7/site-packages (from kiwisolver>=1.0.1->matplotlib) (40.6.3)
> 
> 2019년 5월 23일 (목) 오후 8:00, Brunner, Clemens (clemens.brunner at uni-graz.at) <clemens.brunner at uni-graz.at>님이 작성:
>         External Email - Use Caution        
> 
> What matplotlib version are you using? This was a regression introduced in 3.0.1, but it should be fixed in matplotlib 3.0.2 and later (I recommend that you use the latest release if possible, which is 3.1.0).
> 
> Clemens
> 
> 
> > On 23.05.2019, at 12:47, Soan KIM <cheukusi.kim at gmail.com> wrote:
> > 
> >         External Email - Use Caution        
> > 
> > 
> > Thank you for your reply.
> > It worked perfectly and you saved my day!
> > 
> > but could you take a look at another issue?
> > I get this error when I try to plot with the option, "spatial colors = True" on Jupyter notebook. :
> > 
> > TypeError: get_tightbbox() got an unexpected keyword argument 'bbox_extra_artists'
> > 
> > Thank you.
> > -------------
> > My code : 
> > evoked = epochs.average()
> > evoked.plot(spatial_colors=True)
> > 
> > Error :
> > TypeError                                 Traceback (most recent call last)
> > /anaconda3/envs/mne/lib/python3.6/site-packages/IPython/core/formatters.py in __call__(self, obj)
> >     339                 pass
> >     340             else:
> > --> 341                 return printer(obj)
> >     342             # Finally look for special method names
> >     343             method = get_real_method(obj, self.print_method)
> > 
> > /anaconda3/envs/mne/lib/python3.6/site-packages/IPython/core/pylabtools.py in <lambda>(fig)
> >     242 
> >     243     if 'png' in formats:
> > --> 244         png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs))
> >     245     if 'retina' in formats or 'png2x' in formats:
> >     246         png_formatter.for_type(Figure, lambda fig: retina_figure(fig, **kwargs))
> > 
> > /anaconda3/envs/mne/lib/python3.6/site-packages/IPython/core/pylabtools.py in print_figure(fig, fmt, bbox_inches, **kwargs)
> >     126 
> >     127     bytes_io = BytesIO()
> > --> 128     fig.canvas.print_figure(bytes_io, **kw)
> >     129     data = bytes_io.getvalue()
> >     130     if fmt == 'svg':
> > 
> > /anaconda3/envs/mne/lib/python3.6/site-packages/matplotlib/backends/backend_qt5agg.py in print_figure(self, *args, **kwargs)
> >      86 
> >      87     def print_figure(self, *args, **kwargs):
> > ---> 88         super().print_figure(*args, **kwargs)
> >      89         self.draw()
> >      90 
> > 
> > /anaconda3/envs/mne/lib/python3.6/site-packages/matplotlib/backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, **kwargs)
> >    2051                     bbox_artists = kwargs.pop("bbox_extra_artists", None)
> >    2052                     bbox_inches = self.figure.get_tightbbox(renderer,
> > -> 2053                             bbox_extra_artists=bbox_artists)
> >    2054                     pad = kwargs.pop("pad_inches", None)
> >    2055                     if pad is None:
> > 
> > /anaconda3/envs/mne/lib/python3.6/site-packages/matplotlib/figure.py in get_tightbbox(self, renderer, bbox_extra_artists)
> >    2274         bb.extend(
> >    2275             ax.get_tightbbox(renderer, bbox_extra_artists=bbox_extra_artists)
> > -> 2276             for ax in self.axes if ax.get_visible())
> >    2277 
> >    2278         if len(bb) == 0:
> > 
> > /anaconda3/envs/mne/lib/python3.6/site-packages/matplotlib/figure.py in <genexpr>(.0)
> >    2274         bb.extend(
> >    2275             ax.get_tightbbox(renderer, bbox_extra_artists=bbox_extra_artists)
> > -> 2276             for ax in self.axes if ax.get_visible())
> >    2277 
> >    2278         if len(bb) == 0:
> > 
> > TypeError: get_tightbbox() got an unexpected keyword argument 'bbox_extra_artists'
> > 
> > <Figure size 921x432 with 2 Axes>
> > 
> > 
> > 2019년 5월 23일 (목) 오후 2:40, Brunner, Clemens (clemens.brunner at uni-graz.at) <clemens.brunner at uni-graz.at>님이 작성:
> >         External Email - Use Caution        
> > 
> > Could you try mne.read_epochs_eeglab again? It looks like your .set file already contains the epochs, so this function should do the job. You certainly shouldn't have to construct your own info object, because this information should already be present in raw.info.
> > 
> > Without the data file it is difficult to tell what the exact problem is, so feel free to send it to me if my suggestion doesn't work.
> > 
> > Clemens
> > 
> > 
> > > On 22.05.2019, at 17:59, Soan KIM <cheukusi.kim at gmail.com> wrote:
> > > 
> > >         External Email - Use Caution        
> > > 
> > > 
> > > Thank you so much!! It worked!
> > > but I've faced with another problem making custom epochs. Could you give me some advice?
> > > 
> > > Thank you!!
> > > 
> > > 
> > > I see this error even though I picked 18 channels  :
> > >  
> > > ValueError: All picks must be < n_channels (30), got 30
> > > 
> > > This is my code :
> > > 
> > > event_id = {'S  4':4, 'S  6':6, 'S  7':7, 'S  1':1, 'S  5':5, 'S  3':3, 'S  2':2}
> > > events= mne.events_from_annotations(raw)
> > > n_channels = 32
> > > sampling_rate = 500
> > > info = mne.create_info(n_channels, sampling_rate)
> > > channel_names = ['Fp1', 'Fp2', 'F3', 'F4', 'C3', 'C4', 'P3', 'P4', 'O1', 'O2', 'F7', 'F8', 'T7', 'T8', 'P7', 'P8', 'Fz', 'Cz', 'Pz', 'FC1', 'FC2', 'CP1', 'CP2', 'FC5', 'FC6', 'CP5', 'CP6', 'TP9', 'TP10', 'EOG', 'M1', 'M2']
> > > channel_types = ['eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eeg', 'eog', 'bio', 'bio']
> > > sfreq = 500
> > > info['description'] = 'My custom dataset'
> > > info['bads'] = ['Fp1', 'Fp2', 'F7', 'F8', 'T7', 'T8', 'TP9', 'TP10']
> > > include = ['F3', 'F4', 'C3', 'C4', 'P3', 'P4', 'O1', 'O2', 'P7', 'P8', 'FC1', 'FC2', 'CP1', 'CP2', 'FC5', 'FC6', 'CP5', 'CP6']
> > > picks = mne.pick_channels(channel_names, include=include, exclude=info['bads'], ordered=False)
> > > tmin= -0.2
> > > tmax = 0.8
> > > custom_epochs = mne.EpochsArray(raw, info, picks, events, event_id)
> > > 
> > > 2019년 5월 22일 (수) 오후 10:26, Brunner, Clemens (clemens.brunner at uni-graz.at) <clemens.brunner at uni-graz.at>님이 작성:
> > >         External Email - Use Caution        
> > > 
> > > 
> > > Hi!
> > > 
> > >  
> > > 
> > > Your markers are probably in raw.annotations. If you want to convert them to events, use mne.events_from_annotations(raw).
> > > 
> > >  
> > > 
> > > Clemens
> > > 
> > >  
> > > 
> > >  
> > > 
> > > From: mne_analysis-bounces at nmr.mgh.harvard.edu <mne_analysis-bounces at nmr.mgh.harvard.edu> On Behalf Of Soan KIM
> > > Sent: Wednesday, 22 May 2019 14:04
> > > To: mne_analysis at nmr.mgh.harvard.edu
> > > Subject: [Mne_analysis] Could you help me find events from ".set" file?
> > > 
> > >  
> > > 
> > >         External Email - Use Caution        
> > > 
> > > Hello, I am a student learning MNE-python.
> > > I have trouble finding events in my ".set" file. It appears empty.
> > > I've also tried mne.io.read_epochs_eeglab with my another epoched
> > > ".set" file, but the list of events is also empty.
> > > To be specific, my raw eeg file was '.vhdr', '.vmrk', and
> > > '.eeg.(BrainProduct)', with no stim_channel. And the data had no
> > > problem when I pre-processed and ran statistics with EEGLAB and
> > > ERPlab. Could you please help me?
> > > 
> > > I attach my continuous eeg file('001.set' , '001.fdt'), and epoched one("001_sync.set", '001_sync.fdt")
> > > 
> > > 
> > > Thank you.
> > > 
> > > -------
> > > This is how my file looks like.
> > > 
> > > <Info | 17 non-empty fields
> > >     bads : list | 0 items
> > >     ch_names : list | Fp1, Fp2, F3, F4, C3, C4, P3, P4, O1, ...
> > >     chs : list | 30 items (EEG: 30)
> > >     comps : list | 0 items
> > >     custom_ref_applied : bool | False
> > >     dev_head_t : Transform | 3 items
> > >     dig : list | 29 items (29 EEG)
> > >     events : list | 0 items
> > >     highpass : float | 0.0 Hz
> > >     hpi_meas : list | 0 items
> > >     hpi_results : list | 0 items
> > >     lowpass : float | 125.0 Hz
> > >     meas_date : NoneType | unspecified
> > >     nchan : int | 30
> > >     proc_history : list | 0 items
> > >     projs : list | 0 items
> > >     sfreq : float | 250.0 Hz
> > >     acq_pars : NoneType
> > >     acq_stim : NoneType
> > >     ctf_head_t : NoneType
> > >     description : NoneType
> > >     dev_ctf_t : NoneType
> > >     experimenter : NoneType
> > >     file_id : NoneType
> > >     gantry_angle : NoneType
> > >     hpi_subsystem : NoneType
> > >     kit_system_id : NoneType
> > >     line_freq : NoneType
> > >     meas_id : NoneType
> > >     proj_id : NoneType
> > >     proj_name : NoneType
> > >     subject_info : NoneType
> > >     xplotter_layout : NoneType
> > > 
> > > -----------
> > > 
> > > This is my code :
> > > 
> > > raw = mne.io.read_raw_eeglab('/001.set', preload=True)
> > > event_id = {'B1(1)': 1, 'B2(2)':2, 'B3(3)':3, 'B4(4)':4, 'B5(5)':5,
> > > 'B6(6)':6, 'B7(7)':7}
> > > events= mne.find_events(raw)
> > > data, times = raw[:, :]
> > > data.shape
> > > start, stop = raw.time_as_index([0, 503955])
> > > data, times = raw[:, start:stop]
> > > times.max()
> > > picks = mne.pick_types(raw.info,meg=False,eeg=True,stim=False,eog=False,ecg=False,misc=False)
> > > 
> > > events = mne.find_events(raw, stim_channel=None, verbose=True)
> > > events[:]
> > > 
> > > array([], shape=(0, 3), dtype=int32)
> > > 
> > > <~WRD000.jpg> 001.fdt<~WRD000.jpg>
> > > 
> > > <~WRD000.jpg> 001.set<~WRD000.jpg>
> > > 
> > > <~WRD000.jpg> 001_sync.fdt<~WRD000.jpg>
> > > 
> > > <~WRD000.jpg> 001_sync.set<~WRD000.jpg>
> > > 
> > >  
> > > 
> > > _______________________________________________
> > > Mne_analysis mailing list
> > > Mne_analysis at nmr.mgh.harvard.edu
> > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> > > 
> > > 
> > > -- 
> > > 서울시 성북구 안암로 145 고려대학교 136-701
> > > Korea University, 145 Anam-ro, Seongbuk-gu, Seoul, Korea
> > > _______________________________________________
> > > Mne_analysis mailing list
> > > Mne_analysis at nmr.mgh.harvard.edu
> > > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> > 
> > 
> > _______________________________________________
> > Mne_analysis mailing list
> > Mne_analysis at nmr.mgh.harvard.edu
> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> > 
> > 
> > -- 
> > 서울시 성북구 안암로 145 고려대학교 136-701
> > Korea University, 145 Anam-ro, Seongbuk-gu, Seoul, Korea
> > _______________________________________________
> > Mne_analysis mailing list
> > Mne_analysis at nmr.mgh.harvard.edu
> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> 
> 
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> 
> 
> -- 
> 서울시 성북구 안암로 145 고려대학교 136-701
> Korea University, 145 Anam-ro, Seongbuk-gu, Seoul, Korea
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis




More information about the Mne_analysis mailing list