compute_source_psd_epochs()

Greetings,

There is an example script called "Compute Power Spectral Density of
inverse solution from single epochs" at
http://martinos.org/mne/auto_examples/time_frequency/plot_compute_source_psd_epochs.html#example-time-frequency-plot-compute-source-psd-epochs-py
.

I noticed that after defining and loading the label into memory, it is
never mentioned again. Line #60 of the script says "compute source space
psd in label" and involves calling the compute_source_psd_epochs()
function, but the label variable is never passed into it as an argument.
Does this function automatically seek a previously defined variable called
label? Are there any options for what labels, how many labels, etc., can be
fed into it?

I want to load a label like lh.BA45.label, but I want it to perform the psd
computations on *both* hemispheres. So far it seems like you can only load
one hemisphere at a time.

Best wishes,

Vincent Rupp Jr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20130402/8391faa1/attachment.html

Hi Vincent,

You are correct, the loaded label isn't used at all. It must be a "copy
paste artifact" from when the example was created.

To your question, if you want to use multiple labels, you can just
combine them using "+", e.g.,

label_both = label_lh + label_rh

and then pass label_both to compute_source_psd_epochs using the label
parameter. The resulting SourceEstimate will contain the PSD for all
labels (the union of all the source space vertices in the labels). Let
me know if you need help splitting the data into the labels again (it's
a few lines of Python code).

I hope this helps.

Martin

hi Vincent,

looks like your problem is fixed. Thanks Martin.

https://github.com/mne-tools/mne-python/pull/550

Best,
Alex

After looking at the example again, I realized that it wasn't a "copy
paste artifact" but that it was a bug as we simply didn't use the label
while it should have been used. This has been fixed in the MNE-Python
development version:

https://github.com/mne-tools/mne-python/pull/550

This is great help. Thanks Martin!

Best wishes,

Vincent Rupp Jr