Skip to content

feat(volume-rendering): fit default 3D presets to each image and add a color reset - #1039

Open
PaulHax wants to merge 3 commits into
mainfrom
volume-fitted-defaults
Open

PaulHax wants to merge 3 commits into
mainfrom
volume-fitted-defaults

Conversation

@PaulHax

@PaulHax PaulHax commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Replaces #1027, #1028, #1029, #1030 and #1031 with a smaller design.

Volumes without a fitting declared modality now render visibly in 3D by default, and the 3D Rendering panel can reset color and opacity to the selected preset.

Default preset

  • DICOM MR defaults to MR-Default instead of CT-Coronary-Arteries-2. CT and US are unchanged.
  • Other single-component images default to CT-AAA when their minimum is at or below -500, as for untagged CT such as NIfTI, and otherwise to Grayscale.

Fitted presets

  • Presets without an absolute range (Grayscale, the colormaps, and now the MR presets) map onto the image's 1st to 99th percentile range, from the image statistics already computed for window/level auto ranges. Until those exist, as while a series streams, the data range is used, and the preset is refit when they arrive unless its color or opacity was edited in the meantime.
  • MR presets map their effective range onto that fitted range, since MR intensities have no standard scale. Presets with an absolute range, including every CT preset, keep their Hounsfield values.
  • Grayscale gets an opacity ramp, transparent at the bottom of the fitted range and opaque at and above its top, and is listed in a new Generic group.
  • The opacity editor keeps the data range as its axis for every preset, and holds the end values beyond the first and last points, as the 3D rendering does.
  • Preset thumbnails use the fitted range and render again once it is known.

Controls

  • A reset button beside Shift and Width reapplies the selected preset, keeping palette and lighting.
  • Shift and Width take their step and bounds from the preset's color range, so Width can narrow ranges narrower than 1.

Opacity points in the state file gain an optional fitRange. State files saved with an MR preset keep their color range, but their opacity curve is now read relative to the image instead of in fixed units.

… percentiles

Volumes without a fitting declared modality now default to a visible 3D
rendering instead of the CT-AAA Hounsfield preset.

- DICOM MR defaults to MR-Default. Other images default to CT-AAA when their
  minimum is at or below -500 (untagged CT), otherwise to Grayscale.
- Presets without an absolute range map onto the image's 1st to 99th
  percentile range from the image statistics, falling back to the data range
  until those are computed. A preset applied on the fallback is refit once
  they arrive, unless its color or opacity was edited meanwhile.
- MR presets map their effective range onto that fitted range, since MR
  intensities have no standard scale. Hounsfield presets are unchanged.
- Grayscale ramps from transparent at the bottom of the fitted range to
  opaque at and above its top, and is listed in a Generic group.
- The opacity editor keeps the data range as its axis for every preset and
  holds the end values past the end points, matching the 3D rendering.
- Preset thumbnails use the fitted range and rerender once it is known.
Adds a reset button beside the Shift and Width sliders in the 3D Rendering
panel. It reapplies the selected preset, restoring the opacity curve, Shift,
and Width for the current image while keeping the palette and lighting
settings.
…range

The Shift and Width sliders took their step from the image data range and
Width had a fixed minimum of 1. For data narrower than 1, such as normalized
floats, Width was pinned and could not narrow the range, and Shift showed a
nonzero value when unshifted.

Step and bounds now come from the preset's color range: the step is at most
1/256 of it, Width starts at one step, and Shift bounds are whole steps
either side of zero. Ranges 256 or wider keep a step of 1.
@netlify

netlify Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for volview-dev ready!

Name Link
🔨 Latest commit 1962e3f
🔍 Latest deploy log https://app.netlify.com/projects/volview-dev/deploys/6afbe099d9adb2dbfa0b1e71
😎 Deploy Preview https://deploy-preview-1039--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