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

**URL:** <https://mne.discourse.group/t/why-mne-viz-brain-cant-work-properly/3002>\
**Category:** Support & Discussions\
**Tags:** ﻿source-localization\
**Created:** [April 17, 2021, 9:33am UTC](https://mne.discourse.group/t/why-mne-viz-brain-cant-work-properly/3002 "2021-04-17T09:33:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kong](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kong](https://mne.discourse.group/u/kong)\
**Post date:** [April 17, 2021, 9:33am UTC](https://mne.discourse.group/t/why-mne-viz-brain-cant-work-properly/3002/1 "2021-04-17T09:33:11Z")

</div>

- 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:

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/0b8b5e7afa384829874dc1e3687fe7efbbf152b6.jpeg)  
 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/11bc1a9dfc4a9f681ee8f1bb5fa108432d82162c.png)  
How does this happen? Is it because that the mne.viz.Brian() API is not complete?If so,how can I cope with that?  
 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/9d97cc30245b255619ed2ecbe587c804eb0aa0da.png)  
It is so kind of you to pay your attention and give me some advice.

---

<div class="post-metadata">

**Author:** ![kong](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kong](https://mne.discourse.group/u/kong)\
**Post date:** [April 17, 2021, 9:55am UTC](https://mne.discourse.group/t/why-mne-viz-brain-cant-work-properly/3002/2 "2021-04-17T09:55:14Z")

</div>

Here is the complete error information:

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/f551f482ebcb2f3e25c53c85de4d9b418b057628.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/9fe333ebb52e8cd29509f025429eadceb146e0b4.png)

---

<div class="post-metadata">

**Author:** ![Deltadown](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@Deltadown](https://mne.discourse.group/u/Deltadown)\
**Post date:** [April 18, 2021, 8:59am UTC](https://mne.discourse.group/t/why-mne-viz-brain-cant-work-properly/3002/3 "2021-04-18T08:59:25Z")

</div>

Actually,I met a similar problem…

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [April 18, 2021, 9:36am UTC](https://mne.discourse.group/t/why-mne-viz-brain-cant-work-properly/3002/4 "2021-04-18T09:36:51Z")

</div>

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

```python
mne.viz.set_3d_backend('pyvista')

```

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

Also tagging @GuillaumeFavelier here.

---

<div class="post-metadata">

**Author:** ![kong](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kong](https://mne.discourse.group/u/kong)\
**Post date:** [April 18, 2021, 4:04pm UTC](https://mne.discourse.group/t/why-mne-viz-brain-cant-work-properly/3002/5 "2021-04-18T16:04:57Z")

</div>

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. 😅  
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!
