apply_inverse_raw with multiple labels

  • MNE-Python version: 0.23.0
  • operating system: CentOS 7

Hi, recently I am trying to perform source localization with MNE. Thanks for the amazing tutorials on relevant topics and I have seemed to reconstrcuted things successfully with a template MRI.

However, since I have a very long time series, reconstructing with the whole brain would instantly kill my computer. I decided to select specific ROI and reconstruct the source only from them. For instance, let’s say the caudlamiddlefrontal-lh from the aparc parcellation.

The command is pretty standard, labels[roi_idx] is the corresponding ROI:

stc = apply_inverse_raw(raw_file, inverse_operator, lambda2, label=labels[roi_idx], method='dSPM', pick_ori=None, verbose=None

The command executed successfully while generating both **** and **** I checked both file, there were data in **** but no data in **** (which is the expected behavior i guess). So, I deleted all **** file manually. Then, performed the whole thing again for caudlamiddlefrontal-rh, and deleted all ****-lh this time.

After that, I used mne.read_source_estimate(**** from the folder storing only the **** and there was an error stating that there were missing files for another hemisphere. So, I put all **** and **** in one folder and it works.

So I wonder:

  1. If we can use apply_inverse_raw with multiple labels at once? Such that we do not have generate source files for both hemi and delete the one that was not included everytime.
  2. If we can use read_source_estimate with file from a single hemisphere?

Thank you very much for the amazing package!


do not delete the empty stc files. mne requires to have both and on read (even if one is empty).

I would save the left label as:

otherwise you can also export your STCs with the .h5 extension (see save method).


1 Like

Thank you very much Alex.