Creating Events in fif file

Hi!

I'm currently working with Catherine Kerr on some meditation data
(collected at Martinos) and would like to use the mne python library.

We are looking to run induced power on our data sets using the python mne
tool. Unfortunately our data is resting data and does not have easily
recognizable events (not much is picked up by mne.find_events), and we'd
like to define our own events/epochs. We'd also like to look at data with
no events.

Is there a way to do this with python? If not, is there a way to predefine
these events using another tool (maybe mne_browse_raw) and then plug the
.fif output into mne's induced_power function.

I'm quite new to all of this and would appreciate any help you may have!

Thank you,

Anna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20120725/2d44105e/attachment.html

Hi,

Following are the two Matlab function (Martin/Alex might convert it into
python) that can create events file for resting sate to look at induce
activity.

Sheraz Khan

Hi!

I'm currently working with Catherine Kerr on some meditation data
(collected at Martinos) and would like to use the mne python library.

We are looking to run induced power on our data sets using the python mne
tool. Unfortunately our data is resting data and does not have easily
recognizable events (not much is picked up by mne.find_events), and we'd
like to define our own events/epochs. We'd also like to look at data with
no events.

Is there a way to do this with python? If not, is there a way to
predefine
these events using another tool (maybe mne_browse_raw) and then plug the
.fif output into mne's induced_power function.

I'm quite new to all of this and would appreciate any help you may have!

Thank you,

Anna
_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis

-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_triggers.m
Type: text/x-objcsrc
Size: 1459 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20120725/9e7013e3/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: writeEventFile.m
Type: text/x-objcsrc
Size: 1177 bytes
Desc: not available
Url : http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20120725/9e7013e3/attachment-0001.bin

Hi Anna,

See below for my reply. Maybe others can chime in with ideas on how to
analyze your data.

Hi!

I'm currently working with Catherine Kerr on some meditation data
(collected at Martinos) and would like to use the mne python library.

We are looking to run induced power on our data sets using the python
mne tool. Unfortunately our data is resting data and does not have
easily recognizable events (not much is picked up by mne.find_events),

mne will only find events if stim channels were used. So if your
experiment doesn't have any predefined events you will not get anything
using mne.find_events

and we'd like to define our own events/epochs. We'd also like to look at
data with no events.

Is there a way to do this with python? If not, is there a way to
predefine these events using another tool (maybe mne_browse_raw) and
then plug the .fif output into mne's induced_power function.

Defining your own events in mne-python is simple. If you look at the
example

http://martinos.org/mne/auto_examples/extract_events_from_raw.html

You see that "events" is a "number of events" x 3 matrix. The first
column is the event time (in samples) and the last the event ID. Say you
want to create evenly spaced events 1s apart you would use (assuming
1kHz sampling rate, excluding 1s at the start and end):

t_events = np.arange(raw.first_samp + 1000, raw.last_samp - 1000, 1000)
events = np.zeros((len(ev_times), 3), dtype=np.int)
events[:, 0] = ev_times
events[:, 2] = 1 # ID of the event

You can then use this event matrix to create epochs etc. in mne-python.

That being said, as your data is resting data, you will not find
anything by averaging epochs. As there is no signal that is time locked
to the events. An alternative approach may be to compute the inverse
solution for different frequency bands and then compare the power in
source space for different conditions.

I hope this helps,

Martin