[Mne_analysis] Setting the Marker channel

Senaka Amarakeerthi senakahks at gmail.com
Sat Jul 8 09:54:17 EDT 2017
Search archives:

Hi,

Got events detected successfully with following code.

data = raw[:, :][0]
data[14] *= 1000000
raw = mne.io.RawArray(data, raw.info)


events = mne.find_events(raw, stim_channel='MARKER')

# prints event data
print('Found %s events, first five:' % len(events))
print(events[:30])

event_id = {'auditory/left': 1, 'auditory/right': 2}

epochs = mne.Epochs(raw, events, event_id=event_id , tmin=-0.2, tmax=0.5)

epochs.plot(block=True)


Through raw.plot(block=True) shows channel signal, after epoching,
epochs.plot(block=True) show only events and no signal.

[image: Inline image 1]


Is there something wrong with the code?





<https://mailtrack.io/> Sent with Mailtrack
<https://mailtrack.io/install?source=signature&lang=en&referral=senakahks@gmail.com&idSignature=22>

On Sat, Jul 8, 2017 at 1:09 PM, Alexandre Gramfort <
alexandre.gramfort at telecom-paristech.fr> wrote:

> hi,
>
> just replace
>
> data = raw.get_data()
>
> by
>
> data = raw[:, :][0]
>
> the get_data method will appear in the next release.
>
> Alex
>
> On Sat, Jul 8, 2017 at 2:14 AM, Senaka Amarakeerthi <senakahks at gmail.com>
> wrote:
>
>> Dear Jaakko,
>>
>> Thank you for quick reply. I tried your code and it complains telling
>> that 'Raw' object has no attribute 'get_data'.
>>
>>
>> Here is the full report of error
>>
>> Opening raw data file /Users/Senaka/to_share-raw.fif...
>> Isotrak not found
>>     Range : 0 ... 55935 =      0.000 ...   436.992 secs
>> Ready.
>> Adding average EEG reference projection.
>> 1 projection items deactivated
>> Reading 0 ... 55935  =      0.000 ...   436.992 secs...
>> Traceback (most recent call last):
>>   File "/Users/Senaka//test.py", line 3, in <module>
>>     data = raw.get_data()
>> AttributeError: 'Raw' object has no attribute 'get_data'
>>
>>
>> Thanks and regards,
>>
>> Senaka
>>
>>
>>
>> <https://mailtrack.io/> Sent with Mailtrack
>> <https://mailtrack.io/install?source=signature&lang=en&referral=senakahks@gmail.com&idSignature=22>
>>
>> On Fri, Jul 7, 2017 at 7:49 PM, Jaakko Leppakangas <jaeilepp at gmail.com>
>> wrote:
>>
>>> Hi,
>>> it seems that the stim channel is assigned as EEG for some reason
>>> (probably a mistake in the acquisition). Also the values on the stim
>>> channel are micro scale causing the event finding to fail. Here's a short
>>> script for fixing raw object.
>>>
>>> import mne
>>> raw = mne.io.read_raw_fif('to_share-raw.fif', preload=True)
>>> data = raw.get_data()
>>> data[14] *= 1000000
>>> raw = mne.io.RawArray(data, raw.info)
>>> raw.set_channel_types({'STI 014': 'stim'})
>>>
>>> -Jaakko
>>>
>>>
>>> On Fri, Jul 7, 2017 at 3:50 PM, Senaka Amarakeerthi <senakahks at gmail.com
>>> > wrote:
>>>
>>>> Dear Alex,
>>>>
>>>> Please find the to_share-raw.fif file by accessing following link.
>>>>
>>>> https://www.dropbox.com/s/58ji93q7xj6nett/to_share-raw.fif?dl=0
>>>>
>>>> Best regards,
>>>>
>>>> Senaka
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> <https://mailtrack.io/> Sent with Mailtrack
>>>> <https://mailtrack.io/install?source=signature&lang=en&referral=senakahks@gmail.com&idSignature=22>
>>>>
>>>> On Fri, Jul 7, 2017 at 12:10 PM, Alexandre Gramfort <
>>>> alexandre.gramfort at telecom-paristech.fr> wrote:
>>>>
>>>>> that's indeed unexpected.
>>>>>
>>>>> can you share the file?
>>>>>
>>>>> data.save('to_share-raw.fif')
>>>>>
>>>>> thx
>>>>> Alex
>>>>>
>>>>> _______________________________________________
>>>>> 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.
>>>
>>>
>>
>>
>>
>>
>> _______________________________________________
>> 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/20170708/0e82a157/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 32795 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170708/0e82a157/attachment-0001.png 


More information about the Mne_analysis mailing list