mne-tools / mne-tools/mne-python
[BUG] `mne.viz.Brain` volume rendering doesn't show up
Open
Nobody has claimed this yet.
DOC
EASY
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 1.6k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 100
Description
If you don't set alpha=0, you get an opaque inflated brain along with your volume source estimate. I think the default arguments could handle this better.

To replicate:
import mne
from mne.datasets import sample
from mne import read_evokeds
from mne.minimum_norm import apply_inverse, read_inverse_operator
data_path = sample.data_path()
meg_path = data_path / 'MEG' / 'sample'
fname_inv = meg_path / 'sample_audvis-meg-vol-7-meg-inv.fif'
fname_evoked = meg_path / 'sample_audvis-ave.fif'
snr = 3.0
lambda2 = 1.0 / snr ** 2
method = "dSPM" # use dSPM method (could also be MNE or sLORETA)
# Load data
evoked = read_evokeds(fname_evoked, condition=0, baseline=(None, 0))
inverse_operator = read_inverse_operator(fname_inv)
src = inverse_operator['src']
# Compute inverse solution
stc = apply_inverse(evoked, inverse_operator, lambda2, method)
stc.crop(0.0, 0.2)
brain = mne.viz.plot_source_estimates(stc, subject='sample', subjects_dir=data_path / 'subjects', src=src)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided sample-data reproduction and inspect the mne.viz.Brain and mne.viz.plot_source_estimates entry points, especially their default arguments. Determine why the volume source estimate is hidden unless alpha=0. Done means the volume rendering is visible with the defaults and the reported reproduction no longer shows an opaque inflated brain over it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100