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.
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).
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: