Fix volumetric MIP - #14187
Merged
Merged
Conversation
larsoner
requested review from
agramfort,
drammock and
wmvanvliet
as code owners
August 21, 2026 18:18
drammock
approved these changes
Aug 22, 2026
Co-authored-by: Daniel McCloy <dan@mccloy.info>
larsoner
enabled auto-merge (squash)
August 22, 2026 21:12
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Acomponent ofRGBAto map to absolute intensity (and map the actual desired voxel alpha elsewhere), as VTK evaluates theAchannel 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,vtkMultiVolumeis broken for MIP.Comparison, main (blue always wins) by simplifying the LCMV example:
PR (highest voxel along view ray wins):
Also fixes a minor bug with
blending="composite", interpolation="nearest"where settingShadeOnwould give a grid outline artifact:Now fixed:
Changes drafted with Opus 5 and reviewed and iterated on by me.