Creating inverse operator

Hello everyone;

  • MNE version: 1.6.1
  • operating system: Windows 10

I want to create inverse operator so I can plot them in source location. However, I just have a raw EEG data and I don’t have a structural MRI scan of the subject. As I understand, MNE provides standard source spaces with predefined locations but I couldn’t make it.
Now, I want to know how I can inverse operator for my data. If there is anyone could help me with this or if there are any resources that could provide further insight, I would greatly appreciate it.

Hello, you need to

  • apply a template montage like standard_1005
  • pass subject="fsaverage" when calling setup_source_space()
  • pass trans="fsaverage" when calling make_forward_solution()

Best wishes,

1 Like

Hello @richard
I did like you said in setup_source_space()

src = mne.setup_source_space(subject='fsaverage', spacing='oct6', subjects_dir=None)

I got this error:

KeyError: ‘Key “SUBJECTS_DIR” not found in the environment or in the the mne-python config file (C:\Users\Eng\.mne\mne-python.json). Try either os.environ[“SUBJECTS_DIR”] = VALUE for a temporary solution, or mne.utils.set_config(“SUBJECTS_DIR”, VALUE, set_env=True) for a permanent one. You can also set the environment variable before running python.’

Can I use the subjects that stored in mne.dataset subjects_dir=mne.datasets.sample.data_path() / "subjects"

I appreciate your help.


You can use fetch_fsaverage() to retrieve the required FreeSurfer files.

Best wishes,

Thanks alot

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.