[Mne_analysis] trouble reading the triggers in a .BDF file

Teon Brooks teon.brooks at gmail.com
Sun Jun 5 13:28:23 EDT 2016
Search archives:

Hi David,

The BDF file does have the original stimulus channel.

Since your trigger values are represented from 0 to 32 (first six bits) and
we permit trigger values up to 2**17 (some DIO triggering device can permit
up 24bit triggers), you will need to mask the higher bit values of the
trigger channel.

This can be done with the function, mne.find_events(raw=raw, mask=2**17 -
32). This should provide you with your triggers.

I just started a discussion
<https://github.com/mne-tools/mne-python/issues/3284> on github about this
mask argument, and there might be an API change to make it more
user-friendly. As for now, this would be the solution to your problem.

HTH


teon
--
Teon Brooks <http://teonbrooks.github.io>, PhD Candidate
twitter: @teon_io <http://www.twitter.com/teon_io>

On Sun, Jun 5, 2016 at 4:45 AM, David Soto <d.soto.b at gmail.com> wrote:

> Hi Teon,
>
> thanks for the message. True I uploaded .edf version of the original .bdf
> the original pdf can be found here
> https://drive.google.com/open?id=0B0PbSnFq24yMZWxoWGNFNGctQmM
> I think the channel info was 'STI 014' as this appears to be the only
> place where I get events id
>
> [ 65281  65282 etc]
>
>
> definitely I am missing something in how to read the triggers from biosemi
>
> Looking at mne.io.read_raw_edf, there appears to be required an annotation
> file and annotation map to interprete the stim_channel...but am not clear
> what is to be done here
>
>
> cheers,
> david
>
> On 5 June 2016 at 03:13, Teon Brooks <teon.brooks at gmail.com> wrote:
>
>> Hi David,
>>
>> I just had a look at your edf file that you uploaded, and quick question,
>> is this the correct file or is there a .BDF that you are trying to analyze?
>> I had a look at the header of this file, and there isn't a stim channel
>> listed ($head Anna\ Priming-edf.edf). Here, I see that there are 132 EEG
>> channels, and two reference channels. Is this the same file your colleague
>> looked at, if so, what channel did they see the corresponding trigger
>> channels on?
>>
>> Quick explanation for what you saw on the supposed trigger channel: the
>> reader assumes the last channel of the data block is the stimulus channel
>> (i.e. stim_channel=-1), which is the typical setting. The values you saw
>> were the software attempt to decode the stim channel values.
>>
>> You can look to see how the test data for edf and bdf list either
>> triggers or annotation for the triggering information (cf.
>> mne-python/mne/io/edf/tests/data/).
>>
>> Feel free to follow up and I can try to further debug this problem.
>>
>> Hope this helps,
>>
>>
>> teon
>> --
>> Teon Brooks <http://teonbrooks.github.io>, PhD Candidate
>> twitter: @teon_io <http://www.twitter.com/teon_io>
>>
>> On Sat, Jun 4, 2016 at 5:07 PM, David Soto <d.soto.b at gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I have data from  a study in which  Eprime was used  to send triggers
>>> (integer numbers from 0-32) to the eeg system.
>>> When I load the data using 'mne.io.read_raw_edf' and I try to load the
>>> the trigger info  'mne.find_events(mydata)' I see only 5 digit numbers
>>>  such as 65303, and even when I count the number of triggers of each type
>>> it does not match what is expected.
>>> I also tried to convert these numbers to 2 high and low byte numbers but
>>> again the actual numbers and the amount do not match what is expected. I
>>> have no idea what the problem is but I am sure the trigger info is well
>>> contained in the  .bdf file, as a colleague of mine analysed this data for
>>> a different research  purpose using Brain Vision Analyser. I am quite keen
>>> on learning mne-python so any advise on how to load this trigger info would
>>> be much appreciated.
>>> In case it is useful a sample of the data can be downloaded here
>>> https://drive.google.com/open?id=0B0PbSnFq24yMc2tKU29zWHZKRU0
>>>
>>> thanks!
>>>
>>> david
>>>
>>>
>>> _______________________________________________
>>> Mne_analysis mailing list
>>> Mne_analysis at nmr.mgh.harvard.edu
>>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>>
>>>
>>> The information in this e-mail is intended only for the person to whom
>>> it is
>>> addressed. If you believe this e-mail was sent to you in error and the
>>> e-mail
>>> contains patient information, please contact the Partners Compliance
>>> HelpLine at
>>> http://www.partners.org/complianceline . If the e-mail was sent to you
>>> in error
>>> but does not contain patient information, please contact the sender and
>>> properly
>>> dispose of the e-mail.
>>>
>>>
>>
>> _______________________________________________
>> Mne_analysis mailing list
>> Mne_analysis at nmr.mgh.harvard.edu
>> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>>
>>
>> The information in this e-mail is intended only for the person to whom it
>> is
>> addressed. If you believe this e-mail was sent to you in error and the
>> e-mail
>> contains patient information, please contact the Partners Compliance
>> HelpLine at
>> http://www.partners.org/complianceline . If the e-mail was sent to you
>> in error
>> but does not contain patient information, please contact the sender and
>> properly
>> dispose of the e-mail.
>>
>>
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
> The information in this e-mail is intended only for the person to whom it
> is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in
> error
> but does not contain patient information, please contact the sender and
> properly
> dispose of the e-mail.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160605/d25a0520/attachment.html 


More information about the Mne_analysis mailing list