It would be good if stc.extract_label_time_course worked on stcs that are already confined to labels
Similarly it would be useful to have a method for putting derived measures back in to stc form for visualization.
Below is a use-case although more meaning full uses would come from apply_inverse_raw and apply_inverse_epochs.
I don't know my way around labels and sourcespaces, but if someone would like to give me a quick break down on how these could be resolved I'd be happy to take a shot at it.
import mne
from mne.datasets import sample
from mne.minimum_norm import read_inverse_operator, apply_inverse
data_path = sample.data_path()
label = 'Aud-lh'
label_fname = data_path + '/MEG/sample/labels/%s.label' % label
fname_inv = data_path + '/MEG/sample/sample_audvis-meg-oct-6-meg-inv.fif'
fname_evoked = data_path + '/MEG/sample/sample_audvis-ave.fif'
subjects_dir = data_path + '/subjects'
snr = 3.0
lambda2 = 1.0 / snr ** 2
method = "dSPM" # use dSPM method (could also be MNE or sLORETA)
# Load data
evoked = mne.read_evokeds(fname_evoked, condition=0, baseline=(None, 0))
inverse_operator = read_inverse_operator(fname_inv)
src = inverse_operator['src']
label = mne.read_label(label_fname)
# Compute inverse solution
pick_ori = "normal" # Get signed values to see the effect of sign filp
stc = apply_inverse(evoked, inverse_operator, lambda2, method,
pick_ori=pick_ori, label=label)
stc_full = apply_inverse(evoked, inverse_operator, lambda2, method,
pick_ori=pick_ori)
stc_in_label = stc_full.in_label(label)
# these fails!
mean = stc.extract_label_time_course(label, src, mode='mean')
mean_2 = stc_in_label.extract_label_time_course(label, src, mode='mean')
# it would then be good to be able to put it (or some derived measure) back
stc_label = mne.label_data_to_stc(label, mean, src)
It would be good if
stc.extract_label_time_courseworked on stcs that are already confined to labelsSimilarly it would be useful to have a method for putting derived measures back in to stc form for visualization.
Below is a use-case although more meaning full uses would come from
apply_inverse_rawandapply_inverse_epochs.I don't know my way around labels and sourcespaces, but if someone would like to give me a quick break down on how these could be resolved I'd be happy to take a shot at it.