Skip to content

fix(volume-rendering): bin the opacity editor histogram over the opacity range - #1030

Open
PaulHax wants to merge 4 commits into
volume-coloring-resetfrom
volume-opacity-histogram-range
Open

PaulHax wants to merge 4 commits into
volume-coloring-resetfrom
volume-opacity-histogram-range

Conversation

@PaulHax

@PaulHax PaulHax commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Builds on #1029. Part of the series replacing #1003.

The opacity editor drew its histogram and color bar over the raw data range while the opacity curve uses the opacity mapping range. With #1028 those can differ, so an outlier could flatten the histogram and leave the color bar a single color.

The histogram is now binned over the opacity mapping range from a fixed-size sample of the scalars, and it updates when the image, preset, or range changes. Sampling also removes the full-array pass that blocked the main thread on large volumes, and the synchronous update cannot be overwritten by an older result.

On volumes larger than the sample size the histogram is an estimate from the sample.

…ity range

The opacity editor binned its histogram, and drew its color bar, over the
raw scalar range while the curve spans the opacity mapping range. Fitted
presets map onto a narrower robust range, so a far outlier collapsed the
histogram into one bin. Bin a fixed-size sample over the opacity range
instead, which also replaces the per-image worker pass that stalled the
main thread on large volumes and could finish after a newer request.
An integer range narrower than the editor's 256 bins left empty bins
between levels, drawing the histogram as a comb.
@PaulHax
PaulHax force-pushed the volume-opacity-histogram-range branch from 9c80581 to cdfdb82 Compare November 15, 2026 09:33
@PaulHax
PaulHax added this pull request to stack #1036 November 15, 2026 16:55
@netlify

netlify Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for volview-dev ready!

Name Link
🔨 Latest commit cdfdb82
🔍 Latest deploy log https://app.netlify.com/projects/volview-dev/deploys/6af9e40d0e2e18a09eb61e43
😎 Deploy Preview https://deploy-preview-1030--volview-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

This branch has not been deployed

No deployments
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.

1 participant