compute_source_psd in volume source spaces

Hi,
I would like to calculate the psds in volume source spaces.
For the moment I have modified the example: : Source reconstruction using an LCMV beamformer
and instead of evoked data I have used the psds in the sensor space.
Here is my code:

  • MNE version: e.g. 0.24.0
  • operating system: Ubuntu 18.04
psds, freqs = psd_multitaper(epochs, fmin,fmax, n_jobs=-1)
epochs.data=psds
evoked = epochs.average()
evoked.data=epochs.data.mean(0)
evoked.times=freqs
filters_vec = make_lcmv(evoked.info, forward, data_cov, reg=0.05,reduce_rank = True,
                        noise_cov=noise_cov, pick_ori='vector',
                        weight_norm='unit-noise-gain', rank=rank)
stc_vec = apply_lcmv(evoked, filters_vec, max_ori_out='signed')

Do you know a more direct method?
Best,
Leila

Unfortunately this will not be correct – PSDs are power, i.e., a nonlinear transform has been applied. So applying the LCMV filters to these data will not give the correct result.

Even though it will be slow, you should apply your LCMV to the evoked data itself like stc = apply_lcmv_epochs(epochs, ...), then compute the PSD of the resulting STCs using psd_array_multitaper, and average those.

Also keep in mind that it does matter when you take the average – the PSD of the average over epochs will be different from the average over the PSDs of each epoch. They tell you different things about your data. This is true whether you compute your PSDs in source or sensor space.

Thank you very much Eric,
I did as you suggested
stc = apply_lcmv_epochs(epochs, filters, max_ori_out='signed')
My goal is to get the Morph psds to fsaverage. Are you suggesting that I first compute psds and then morph to fsaverage or that I first morph stc to fsaverage and then compute psds?
I understand the difference between Mean(psd) and psd(Mean)