The source estimate is not displayed, I think it may be a bug?

The following error occurred while I was plotting the source estimate. The specified file could not be found. Includes white files and inflated files. I think this is a bug, because these files exist on my computer. As shown in the figure below, I have conducted many experiments.

method = "dSPM" 
snr = 3. 
lambda2 = 1. / snr ** 2 # lambda2=0.1111111111111111 
stc = apply_inverse(epochs['Cue'].average(), inverse_operator, lambda2, 
                    method=method, pick_ori=None) 
 brain = stc.plot(surface='white ', # or 'white' 

Here’s how I tested it

This is one

Here’s another

import mne 
import pathlib 
import numpy as np 
sample_data_folder = pathlib.Path('/home/meg') 
subjects_dir = sample_data_folder / "subjects"  
Brain = mne.viz.get_brain_class() 
brain = Brain( 
    "test", hemi="both", surf="pial", subjects_dir=subjects_dir, size=(800, 600)
brain.add_annotation("aparc.a2009s", borders=False)

This is a try with FreeView

I don’t know why it can’t find the file. This was done on the ubuntu20 OS.

Looking forward to your reply

  • MNE version: 1.4.0
  • operating system: Ubuntu 20.04

When I used Windows 10, this error did not occur. Normal plot

What is the output of

ls -lah /home/meg/subjects/test/surf/lh.white


@zuferlot I can see a small mistake in your code.
brain = stc.plot(surface='white ') <<- error line

Remove the space after white to complete the string .

It should work.

For replicating such issues, please use MNE example code. So that we can easily replicate the issue as well.


1 Like

Very good catch. This suggests the error message should probably display quotation marks around names of files that were not found, so as not to “hide” trailing spaces.

1 Like