Skip to content

Fix volumetric MIP - #14187

Merged
larsoner merged 4 commits into
mne-tools:mainfrom
larsoner:mip
Aug 23, 2026
Merged

Fix volumetric MIP#14187
larsoner merged 4 commits into
mne-tools:mainfrom
larsoner:mip

Conversation

@larsoner

Copy link
Copy Markdown
Member

For volumetric viz and two-sided data in MIP mode, we currently create two volumes: one MIP and one MinIP. This is problematic because of how multiple MIP/MinIP volumes are rendered -- there is no depth sorting / resolution, so which is shown depends on actor addition order.

Turns out there is a way around this: create a single volume and use the A component of RGBA to map to absolute intensity (and map the actual desired voxel alpha elsewhere), as VTK evaluates the A channel to decide "what is maximal" in the volume. There is in principle a slightly better way to do this (that wouldn't require re-baking values) -- "independent component" mode -- but it's broken for MIP. The other possible solution, vtkMultiVolume is broken for MIP.

Comparison, main (blue always wins) by simplifying the LCMV example:

before

PR (highest voxel along view ray wins):

after

Also fixes a minor bug with blending="composite", interpolation="nearest" where setting ShadeOn would give a grid outline artifact:

composite_before

Now fixed:

composite_after

Changes drafted with Opus 5 and reviewed and iterated on by me.

Comment thread doc/changes/dev/14187.bugfix.rst Outdated
Comment thread mne/viz/backends/_pyvista.py Outdated
Comment thread mne/viz/backends/_pyvista.py Outdated
@larsoner
larsoner enabled auto-merge (squash) August 22, 2026 21:12
@larsoner

Copy link
Copy Markdown
Member Author

pip-pre failures are just pyqtgraph/pyqtgraph#3585 so I'll merge manually (will pin tomorrow if they don't merge my PR ASAP)

@larsoner
larsoner disabled auto-merge August 23, 2026 01:45
@larsoner
larsoner merged commit a6bc556 into mne-tools:main Aug 23, 2026
28 of 31 checks passed
@larsoner
larsoner deleted the mip branch August 23, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants