Why mne.viz.Brain() can't work properly?

  • MNE-Python version: 0.22.1
  • operating system: windows10,python 3

Hi! I wonder if there will be someone so kind that he can help me.When I reading the tutorials about Source modeling"How mne use Freesurfer outputs" ,I use totally the same code with the example but
get an assertation error,which is as follows:

How does this happen? Is it because that the mne.viz.Brian() API is not complete?If so,how can I cope with that?

It is so kind of you to pay your attention and give me some advice.

Here is the complete error information:

Actually,I met a similar problem…

Hello @kong and @Deltadown, and welcome to the forum! I didn’t have time to look into this yet, but what caught my attention is that apparently you’re using Mayavi, while pyvista is our 3D backend of choice for source visualization these days. Have you tried using pyvista (actually it should be default on MNE 0.22, if I’m not mistaken)? If it’s not active by default, as seems to be the case for you, you will need to call


before running your 3D viz. Does that change anything?

Also tagging @GuillaumeFavelier here.

1 Like

Hello Richard!
Thank you for your reply!
I’m very delighted to see the problem was solved and aprreciate your helping.Pyvista might be default on MNE 0.22,my mne use mayavi probably because I hadn’t installed pyvista before. :sweat_smile:
I see your tutorial vedios on Yutoube and it helped me a quite lot .I regard it is so cool of your guys to working about MNE! Thanks a lot!

1 Like