Skip to content

orthoslicer demo: three volume_slice planes beside a volren, a slice view down any axis (P7) - #1257

Merged
transfix merged 30 commits into
masterfrom
p7/orthoslicer-demo
Nov 16, 2026
Merged

transfix merged 30 commits into
masterfrom
p7/orthoslicer-demo

Conversation

@transfix

@transfix transfix commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

The last piece of P7 (docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md): an orthoslicer demo document next to volren_bunny, native and in arigl-web, with a golden image. Stacked on #1249 and #1251: it carries their commits until they merge, then gets master merged in again. Its own commits are e67f04c (the demo), e7148eb (the golden PNG) and 96ead7a (the golden harness waits for volren raycasts).

What lands

  • examples/ariadne/documents/orthoslicer.ari:
    • The bunny's signed distance field, raycast by a volren node with a see-through surface and cut by three volume_slice planes.
    • A slice view (mode: slice, input: pick) down the axis an XY / XZ / ZY switch picks. Drag pans, the wheel zooms about the pointer, a click reads out the voxel and its distance.
    • Sliders for the planes, and the transfer-function editor on the first plane.
    • Added to the gallery as orthoslicer_ari (demos.json, a thumbnail rendered from the document).
  • volume_of: <id> on a volume_slice node: another plane of the volume node <id> draws, coloured through <id>.transfer_function (VolumeSliceNode::setModelKey). So the SDF is computed once, and one editor colours all three planes.
  • Golden: src/cvcGL/test/golden/orthoslicer.ari is the demo at 32³, with the slice view looking down y. The editor is left out because its histogram arrives from a task on no fixed frame.
    • Its PNG is committed (e7148eb). cvcgl_ari_golden writes a reference golden only under Mesa llvmpipe, and this machine has none, so it is Windows CI's llvmpipe render (run 43714300525, artifact ari-golden-Windows-libcvc-release; LLVM 22.1.8, the renderer on which the other goldens match within one step). I looked at it before committing: the Orthoslicer window with XZ selected, the slice view down y, the plane sliders, and the three planes through the volren bunny.
    • The harness waits for the raycast (96ead7a). A volren node raycasts on a worker thread, and until its first raycast lands its quad draws opaque black over the whole view. The Linux Debug job (coverage, llvmpipe) captured the golden before that: a black main view under the ImGui window, 16% of the pixels off (run 43816350350). cvcgl_ari_golden now steps on, where the scene has volren nodes, until each reports VolRenNode::converged with a frame rendered, three frames running, as the volren tests wait (ceiling 120 s). Documents with no volren node take no extra frames. Locally (Windows Release, Intel Arc) the wait took 4 frames; with 12 copies running at once, 4 to 8. All 12 captures differed from the llvmpipe golden by the same 630 px, where Arc picks different texels at the slice view's texel edges than llvmpipe does. The Linux Debug job is the check for the case that failed.
    • macOS may need its own orthoslicer.macos.png the same way, if the Apple renderer lands outside the tolerance.
    • Locally the document loads without warnings, draws 98.5% of the frame, and settles (the next frame is pixel-identical) on an Intel Arc GPU.
  • arigl-web:
    • src/cvc/tests/data/ariadne_docset/app/orthoslicer.ari prints one line once its planes are up and its slice view's camera looks down y.
    • arigl_web_smoke.mjs gains a case that waits for that line with no warnings (arigl only, not ariglx-web).
    • Touching the docset also makes the arigl-web lane run on this PR. Natively the document prints orthoslicer: 32 planes, slice view down y. I couldn't build arigl-web here, so the browser half is unverified until that lane runs.
  • Docs: ARIADNE.md §5.4 and §5.18, the roadmap's P7 row.

Tests (Windows Release, CVC_REQUIRE_RENDER=1)

  • cvcgl_volume_slice, 54 checks (5 new for volume_of): the shared source and model key, a recolour through it, a bad id. Passes.
  • cvcgl_ariadne_slice_view passes.

No new or renamed CI jobs. clang-format is clean on the changed lines.

The first P7 piece of docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md §6 (items 1 and 4).

- Core: cvc::slice_source, extract_slice and color_slice (inc/cvc/volume/volume_slice.h): a
  plane of a volume in memory, or of a file read one plane at a time (region reads, the last
  few planes cached), coloured through a cvc::tf::model. The plane's axes are VolumeGridRover's
  XY / XZ / ZY views. volume_slice_params has a param_table.
- cvcGL: VolumeSliceNode, a textured quad coloured on the CPU through <node>.transfer_function,
  one 2D texture per change of plane (written in place when the size is the same). Keys under
  <node>.slice.*, info.* published, pickRay meets a world ray with the plane exactly and names
  the voxel and its value. Its children are overlays: the quad is pushed back by
  slice.overlay_offset so they stay on top. GeometryNode::setTextureInterpolate for nearest
  sampling.
- Ariadne: `type: volume_slice` in register_cvcgl_extensions (volume_slice_nodes.h); its
  transfer function is bound (tf_binding target volume_slice), so a tf_editor colours it.
- pycvc: extract_slice, color_slice, slice_source, the axis helpers and the parameter table.
- Tests: volume_slice_test (ports lane: native and wasm-mt under node), cvcgl_volume_slice
  (keys, region reads, pickRay, two apps; offscreen: voxel colours, nearest filter, an overlay
  on top), test_pycvc_volume_slice.py.
- Docs: ARIADNE.md §5.4, the roadmap's §6 items 1 and 4.
…the voxel (P7)

The second P7 piece of docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md §6 (items 2 and 3).

- CameraController::Mode::Slice: a parallel view straight down x, y or z (setSliceAxis), with
  VolumeGridRover's screen axes (down z: x right, y up; down y: x right, z up; down x: z right,
  y up), no rotation; frameSlice fits a box's face and refits on resize until the user zooms;
  a drag pans, the movement keys slide and zoom, Tab cannot leave it, and its pose is its own
  (state slice.axis, slice.center.*, slice.scale). mouseWheelAt zooms about the pointer, through
  the glide too; the attached interactor passes the event's position.
- The viewport widget: `mode: slice` with `axis:` a name (x | y | z, or xy / xz / zy) or
  `{ bind: <key> }`, read every frame, so one view follows a switch. A slice view frames on the
  volume_slice nodes on its axis and leaves out the other axes' (edge-on, each is a line).
- Picks: a slice view meets the plane of its slice exactly (no cell tolerance, overlays not in
  the way) and writes i, j, k and value beside x, y, z; past the volume's edge it still writes
  the plane's point with hit 0. An orbit view's pick on a volume_slice node names its voxel too.
- Tests: cvcgl_camera_slice (headless, 37 checks), cvcgl_ariadne_slice_view (offscreen: the bound
  axis, the edge-on slice left out, picks by SceneViews::pick and by the left button, the wheel
  about the pointer, an orbit view's voxel), pycvc_gl's camera test.
- Docs: ARIADNE.md §5.18, the roadmap's §6 items 2 and 3.
…view down any axis (P7)

The last P7 piece of docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md: an orthoslicer document
next to volren_bunny, native and in arigl-web, with a golden image.

- examples/ariadne/documents/orthoslicer.ari: the bunny's SDF raycast by a volren node (its
  surface see-through) and cut by three volume_slice planes; a slice view (mode: slice, input:
  pick) down the axis an XY / XZ / ZY switch picks, sliders for the planes, the probed voxel and
  its distance, and the transfer-function editor on the first plane. In the gallery as
  orthoslicer_ari (demos.json, thumbnail).
- volume_of: <id> on a volume_slice node: another plane of the volume node <id> draws, through
  <id>.transfer_function (VolumeSliceNode::setModelKey), so the SDF is computed once and one
  editor colours all three planes.
- Golden: src/cvcGL/test/golden/orthoslicer.ari (the demo at 32^3, the slice view down y, the
  editor left out since its histogram lands on no fixed frame). Its PNG is written by CI's
  llvmpipe run (the golden test refuses any other renderer): it follows in this PR.
- arigl-web: src/cvc/tests/data/ariadne_docset/app/orthoslicer.ari prints one line once its
  planes are up and its slice view looks down y; arigl_web_smoke.mjs waits for it (arigl only).
- Tests: cvcgl_volume_slice's volume_of checks (shared source and model key, a recolour through
  it, a bad id).
- Docs: ARIADNE.md §5.4 and §5.18, the roadmap's P7 row.
@transfix
transfix enabled auto-merge November 15, 2026 05:26
@transfix
transfix disabled auto-merge November 15, 2026 05:39
transfix added a commit that referenced this pull request Nov 15, 2026
- #1241: the schema's menu_collapse was an enum, so a bad value warned twice (the schema, then
  the loader, which falls back to auto) and MenuCollapseSetting counted 2. The enum also refused
  the yes/no/on/off the loader takes. The schema now checks only the type (boolean or string);
  the loader's warning, which names the fallback, is the one.
- #1258: master's ShippedComponentsLoadClean includes each component file's unit named after it.
  nav_lab_panels.ari had only nav_lab_stats and nav_lab_ledger. It gains nav_lab_panels, a group
  of both windows; the two includes still work as they did.
- #1257: cvcgl_ari_golden found orthoslicer.ari in the golden set with no orthoslicer.png. This is
  the frame the test rendered (Linux, NVIDIA), checked by eye.
- The chart is in libcvc 4.0, not 3.7.14: data_feed.ari, nav_lab_*.ari and NAV_LAB.md.
Windows CI's Mesa llvmpipe render of src/cvcGL/test/golden/orthoslicer.ari (run 43714300525,
artifact ari-golden-Windows-libcvc-release), the renderer the other goldens come from: the
Orthoslicer window with the slice view down y, the plane sliders, and the three volume_slice
planes through the volren bunny.
@transfix
transfix enabled auto-merge (squash) November 15, 2026 20:11
transfix added a commit that referenced this pull request Nov 15, 2026
- #1241 (AriadneLoader.MenuCollapseSetting): the schema's menu_collapse was an enum, so a bad
  value warned twice (the schema, then the loader, which falls back to auto), and the enum refused
  the yes/no/on/off the loader takes. The schema now checks only the type; the loader's warning,
  which names the fallback, is the one.
- #1257 (cvcgl_ari_golden): orthoslicer.ari had no orthoslicer.png. This is the frame CI renders
  (Linux, from #1270's earlier run; Windows renders the same).
- The chart is in libcvc 4.0, not 3.7.14: data_feed.ari, nav_lab_*.ari, nav_lab_stats.ari and
  NAV_LAB.md.

#1258's earlier failures (its component test and NavArms on macOS and Windows) are fixed on its
own branch now.
…olume-slice-node

# Conflicts:
#	docs/ARIADNE.md
#	inc/cvc/gl/ariadne/extensions.h
#	src/cvcGL/ariadne/extensions.cpp
A volren node raycasts on a worker thread, and until its first raycast lands
its quad draws opaque black across the whole view. The Linux Debug job (a
coverage build on llvmpipe) captured the orthoslicer golden before the
raycast landed: the main view was black, only the ImGui window drawn.

The harness now steps on, where the scene has volren nodes, until each one
reports VolRenNode::converged with a frame rendered, three frames running,
as the volren tests wait. The ceiling is 120 s. Documents with no volren
node take no extra frames.
Master now has #1249 as one squashed commit. Its tree equals #1249's last head (7c4c2bf) merged into the master before it (a5e83b1), so this merge's tree is #1251 merged with a5e83b1. The one conflict, in src/cvcGL/CMakeLists.txt, keeps both test blocks: #1251's cvcgl_ariadne_slice_view, then #1249's cvcgl_volume_slice.
@transfix
transfix merged commit 671be1c into master Nov 16, 2026
29 checks passed
@transfix
transfix deleted the p7/orthoslicer-demo branch November 16, 2026 21:35
transfix added a commit that referenced this pull request Nov 16, 2026
One conflict, in src/cvcGL/CameraController.cpp's includes: this branch's <cassert> and #1257's
<cctype> (sliceAxisOf), both kept.
transfix added a commit that referenced this pull request Nov 18, 2026
#1257's orthoslicer golden was made under llvmpipe, and PRs skip the macOS package jobs, so
its first macOS run was the full push CI (44055940377). On all four macOS jobs, on every try,
Apple's software renderer left 1149 px beyond +-40 (0.1662%, allowed 0.0020%), largest channel
difference 187. The frames are the same picture: the nearest-sampled slices' texel edges and the
volren's edges land a pixel apart. The four jobs' orthoslicer.actual.png are the same bytes
(sha256 41d2760b...). That frame is committed as orthoslicer.macos.png, as docs/ARIADNE.md
describes for widgets, scene and grid.
transfix added a commit that referenced this pull request Nov 20, 2026
…d-back where it reports 32F (macOS) (#1333)

* cvcgl_volume_half_float: read the formats VTK asks for, and skip GL's read-back where it reports 32F

On macOS, under Apple's software renderer, the test counted 0 16F textures in both runs and
aborted. The earlier diagnostic run (ci/full/volume-half-float-macos, 43781313300) listed every
live texture there. The probe sees them all, and the volume's two tables (1024x1) are reported
as R32F and RGB32F in the 16F run too. The 16F frame still differs from the 32F one by a
little (mean 0.006, worst 1). That suggests the data was rounded to 16 bits and GL reports the
32F format, not that VTK asked for 32F.

So the test now reads what VTK asks for where it asks: VTK's glad glTexImage2D pointer, swapped
for a recorder once the window is initialised (VTK loads glad once per new context). It
checks, on every desktop GL:
  * the 32F run asks for no 16F textures, and the 16F run asks for at least 2 (the tables);
  * GL keeps them as 16F (at least 2 alive, none in the 32F run), as before.
The read-back is skipped only when GL reports none as 16F AND it keeps every texture asked for
as 16F in the matching 32F format, and the skip names the renderer. Linux and Windows report
16F, so that check stays strict there.

The probe clears stale GL errors first and looks up to name 4095, not 511.

package-macos prints the test's lines from LastTest.log on every run, as for cvcgl_wake, so
the skip and its reason show on a pass.

* cvcgl_ari_golden: a macOS golden for orthoslicer

#1257's orthoslicer golden was made under llvmpipe, and PRs skip the macOS package jobs, so
its first macOS run was the full push CI (44055940377). On all four macOS jobs, on every try,
Apple's software renderer left 1149 px beyond +-40 (0.1662%, allowed 0.0020%), largest channel
difference 187. The frames are the same picture: the nearest-sampled slices' texel edges and the
volren's edges land a pixel apart. The four jobs' orthoslicer.actual.png are the same bytes
(sha256 41d2760b...). That frame is committed as orthoslicer.macos.png, as docs/ARIADNE.md
describes for widgets, scene and grid.
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