- MNE version:1.5.1
- operating system: Windows 10
Hi! I am new with code and mne,and I wish someone kind would help me to solve this problem.
I’m studying the example" Plotting with mne.viz.Brain — MNE 1.6.0 documentation",and when I run this code, an error is generated.
brain_kwargs = dict(alpha=0.1, background="white", cortex="low_contrast")
brain = mne.viz.Brain("sample", subjects_dir=subjects_dir, **brain_kwargs)
stc = mne.read_source_estimate(sample_dir / "sample_audvis-meg")
stc.crop(0.09, 0.1)
kwargs = dict(
fmin=stc.data.min(),
fmax=stc.data.max(),
alpha=0.25,
smoothing_steps="nearest",
time=stc.times,
)
brain.add_data(stc.lh_data, hemi="lh", vertices=stc.lh_vertno, **kwargs)
brain.add_data(stc.rh_data, hemi="rh", vertices=stc.rh_vertno, **kwargs)
The visualizations look like this.
An empty model can be obtained by using the mouse wheel.
The correct result should be this:
After I close the window ,the console contents are as follows.
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
Traceback (most recent call last):
File "C:\Users\zdy15\PycharmProjects\110\venv\Lib\site-packages\IPython\core\interactiveshell.py", line 3526, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-12-f7be9cad9fac>", line 2, in <module>
brain = mne.viz.Brain("sample", subjects_dir=subjects_dir, **brain_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\zdy15\PycharmProjects\110\venv\Lib\site-packages\mne\viz\_brain\_brain.py", line 469, in __init__
self.show()
File "C:\Users\zdy15\PycharmProjects\110\venv\Lib\site-packages\mne\viz\_brain\_brain.py", line 3165, in show
self._renderer.show()
File "C:\Users\zdy15\PycharmProjects\110\venv\Lib\site-packages\mne\viz\backends\_notebook.py", line 1597, in show
viewer.value,
^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'value'
I don’t know what the problem is. I tried to uninstall and reinstall MNE, but it didn’t work. I would be grateful if someone could give me some advice.