[Mne_analysis] Annotations for Events

Dan McCloy dan at mccloy.info
Mon Jan 13 13:36:10 EST 2020
Search archives:

        External Email - Use Caution        

Hi Bianca,
The reason the [source] link still shows the old code is that you were looking at the documentation for the *stable* version of MNE-Python (note the URL begins with https://mne.tools/stable/).  [source] links in the stable documentation don't go to the current master version of the code, they go to a maintenance branch (currently maint/0.19).

If you look at [that page of the documentation for the *development* version of MNE-Python](https://mne.tools/dev/generated/mne.events_from_annotations.html), you'll see in the GitHub URL that the [source] link goes to the current master branch instead of maint/0.19, and the recent changes to the docstring are indeed shown there.

-- dan
Daniel McCloy
https://dan.mccloy.info
Research Scientist
Institute for Learning and Brain Sciences
University of Washington

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, January 13, 2020 10:21 AM, Bianca Islas <biancaisla1 at gmail.com> wrote:

> Mr. McCloy,
>
> My apologies for the late response.  I looked at changes made for docstring #7183, notes and crossref implementation for annotations.py.  I think that these notes are clear and would have prevented the difficulty.  However I did notice that when going to the source code link from the MNE [page](https://mne.tools/stable/generated/mne.events_from_annotations.html), it did not show the changes for lines 899-900 and 941.  Will this take effect after review?  Thank you all for addressing these concerns as related to Neuroscan .cnt file annotations.
>
> Very Best,
>
> Bianca Islas
>
> Research Assistant
>
> Psychophysiology of Emotion and Personality Lab
>
> University Nevada, Las Vegas
>
> From: [Dan McCloy](mailto:dan at mccloy.info)
> Sent: Tuesday, January 7, 2020 10:04 AM
> To: [Discussion and support forum for the users of MNE Software](mailto:mne_analysis at nmr.mgh.harvard.edu)
> Subject: Re: [Mne_analysis] Annotations for Events
>
>         External Email - Use Caution
>
> Hi Bianca,
>
> Can you have a look at https://github.com/mne-tools/mne-python/pull/7183 and see if the docstring changes there are clear, and would have prevented your difficulty?
>
> -- dan
>
> Daniel McCloy
>
> http://dan.mccloy.info
>
> Research Scientist
>
> Institute for Learning and Brain Sciences
>
> University of Washington
>
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>
> On Saturday, January 4, 2020 3:24 PM, Bianca Islas <biancaisla1 at gmail.com> wrote:
>
>>         External Email - Use Caution
>>
>> Yes, entirely different.  I first define an event_dict.  My reading in the .cnt file is verbatim:
>>
>> `raw = mne.io.read_raw_cnt(input_fname=raw_fname, eog=('VEO', 'HEO',), misc=('SCR', 'SCL',), ecg=('HR',),
>>
>>                           emg=('PA-L-SCAL', 'PA-L-EAR', 'PA-R-SCAL', 'PA-R-EAR', 'ORB-NOSE', 'ORB-EAR', 'COR-NOSE', 'COR-EAR', 'ZYG-MOUTH', 'ZYG-EAR',),
>>
>>                           data_format='int32', date_format='dd/mm/yy', preload=True)
>>
>> events = mne.events_from_annotations(raw_corrected, event_id=event_dict)
>>
>> print(events, raw_corrected) #corrected raw data after ICA`
>>
>> Implementing `event_id=int` into `events_from_annotations`, as in your code, was the difference.  This is not in the documentation for this [function](https://mne.tools/stable/generated/mne.events_from_annotations.html). So I’m glad we were able to cover it here.  Thank you for your time and patience in clearing this up!
>>
>> Bianca Islas
>>
>> From: [Alexandre Gramfort](mailto:alexandre.gramfort at inria.fr)
>>
>> Sent: Saturday, January 4, 2020 8:50 AM
>>
>> To: [Bianca Islas](mailto:biancaisla1 at gmail.com)
>>
>> Cc: mne_analysis at nmr.mgh.harvard.edu
>>
>> Subject: Re: Annotations for Events
>>
>> hi,
>>
>> I tried
>>
>> import mne
>>
>> raw = mne.io.read_raw_cnt('st003_PAMR_s1079_20080319.cnt')
>>
>> events, event_id = mne.events_from_annotations(raw, event_id=int)
>>
>> print(events)
>>
>> print(event_id)
>>
>> and it worked fine.
>>
>> are you doing anything differently?
>>
>> Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200113/d702fe69/attachment.html 


More information about the Mne_analysis mailing list