Skip to content

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

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

PaulHax wants to merge 5 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.

Integer ranges narrower than the bin count get one bin per level, with at least three, so a binary mask draws its two levels as separate peaks.

@PaulHax
PaulHax force-pushed the volume-opacity-histogram-range branch from 325940a to 20be1f3 Compare November 13, 2026 03:53
@PaulHax
PaulHax force-pushed the volume-opacity-histogram-range branch 2 times, most recently from 7098eb5 to 9c80581 Compare November 14, 2026 20:17
@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 f4a4808
🔍 Latest deploy log https://app.netlify.com/projects/volview-dev/deploys/6afbc03a6f469b192478e4a6
😎 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.

@PaulHax
PaulHax force-pushed the volume-opacity-histogram-range branch from cdfdb82 to bedc4a3 Compare November 16, 2026 22:45
…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 commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #1039, which reworks this series into a smaller design: fitted presets use the existing image statistics, the opacity editor keeps the data range as its axis for every preset, and the default modality comes from DICOM only.

@PaulHax PaulHax closed this Nov 17, 2026
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