how to save source estamates from epoched data set with multiple events

Hi all,
I am trying to extract from a structural roi a time series source estimate for each one of the epoch in each of my conditions

first I read in the saved epoched data fif file:

epochs=mne.read_epochs(fname_epoched)

next I apply the inverse operator that I created using the evoked data and the anatomic label previously created and execute the following:

stcs = apply_inverse_epochs(epochs,inverse_operator, lambda2, method, anat_label1,
                            pick_ori="normal")

what I would like to do next is calculate the mean activation within this roi comprising 480 vertices. so that I have one average value for each of my epochs and conditions and save an output matrix comprising time series for each epoch and including a vector for event id

I tried picking up from the a similar stage in the plot_compute_mne_inverse_epochs_in_label.py substituting my commands above for

# Read epochs
epochs = mne.Epochs(raw, events, event_id, tmin, tmax, picks=picks,
                    baseline=(None, 0), reject=dict(mag=4e-12, grad=4000e-13,
                                                    eog=150e-6))

# Compute inverse solution and stcs for each epoch
stcs = apply_inverse_epochs(epochs, inverse_operator, lambda2, method, label,
                            pick_ori="normal")

mean_stc = sum(stcs) / len(stcs)

but mean_stc is not what I want and stcs does not have attribute save like for example stc.save

any help would be appreciated
thanks dave

hi David,

have a look at:

http://martinos.org/mne/stable/auto_examples/inverse/plot_label_source_activations.html

extract_label_time_course will give you a time series per stc, then you can make
an array from all time courses and save it as a numpy binary file with np.save

let me know if you need more help

HTH
Alex

thanks I have been using this example as a base but I was curious about the following:
1. can stc.extract_label_time_course work on a epoched data . fif file containing all my event condtions
2. lets say I want to extract as a time course just the vertices with the center of mass or perhaps an roi reflecting this vertices and a small number of neighboring vertices instead of the mean of a whole anatomic roi label. how could I do that?
3 ) with np.save can I also ad a vector that corresponds to the event type that each epoch represents?

thanks //dave

hi David,

have a look at:

http://martinos.org/mne/stable/auto_examples/inverse/plot_label_source_activations.html

extract_label_time_course will give you a time series per stc, then you can make
an array from all time courses and save it as a numpy binary file with np.save

let me know if you need more help

HTH
Alex

Hi all,
I am trying to extract from a structural roi a time series source estimate for each one of the epoch in each of my conditions

first I read in the saved epoched data fif file:

epochs=mne.read_epochs(fname_epoched)

next I apply the inverse operator that I created using the evoked data and the anatomic label previously created and execute the following:

stcs = apply_inverse_epochs(epochs,inverse_operator, lambda2, method, anat_label1,
                           pick_ori="normal")

what I would like to do next is calculate the mean activation within this roi comprising 480 vertices. so that I have one average value for each of my epochs and conditions and save an output matrix comprising time series for each epoch and including a vector for event id

I tried picking up from the a similar stage in the plot_compute_mne_inverse_epochs_in_label.py substituting my commands above for

# Read epochs
epochs = mne.Epochs(raw, events, event_id, tmin, tmax, picks=picks,
                   baseline=(None, 0), reject=dict(mag=4e-12, grad=4000e-13,
                                                   eog=150e-6))

# Compute inverse solution and stcs for each epoch
stcs = apply_inverse_epochs(epochs, inverse_operator, lambda2, method, label,
                           pick_ori="normal")

mean_stc = sum(stcs) / len(stcs)

but mean_stc is not what I want and stcs does not have attribute save like for example stc.save

any help would be appreciated
thanks dave

_______________________________________________
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.

David I. Leitman PhD

Research Assistant Professor
Department of Psychiatry-
Neuropsychiatry program
Perelman School of Medicine
University of Pennsylvania
Gates Pavilion 10th floor room 1042
3400 Spruce St
Philadelphia, PA 19104-4283
P: (215) 662-7389
F: (215) 662-7903
E: leitman at mail.med.upenn.edu
Faculty page: http://www.med.upenn.edu/apps/faculty/index.php/g275/p8174343
Lab website:
http://davidileitman.com

The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the the Neuropsychiatry Section immediately by e-mail, and delete the original message.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140113/ca083146/attachment.html