Skip to content

volume_slice: one axis-aligned plane of a volume as a scene node (P7) - #1249

Merged
transfix merged 8 commits into
masterfrom
p7/volume-slice-node
Nov 16, 2026
Merged

transfix merged 8 commits into
masterfrom
p7/volume-slice-node

Conversation

@transfix

Copy link
Copy Markdown
Owner

The first piece of P7 (docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md §6 items 1 and 4): the axis-aligned slice node VolumeGridRover's views and the orthoslicer demo build on.

What lands

  • Core (inc/cvc/volume/volume_slice.h): cvc::slice_source (a volume in memory, or a volume file read one plane at a time with region reads, the last few planes cached), extract_slice, color_slice (through a cvc::tf::model), the slice grid's planes and voxels, and volume_slice_params with its param_table. The plane's axes are VolumeGridRover's XY / XZ / ZY views. No statics.
  • cvcGL (inc/cvc/gl/VolumeSliceNode.h): a textured quad coloured on the CPU through <node>.transfer_function. Each change of plane, axis or transfer function uploads one 2D texture, written in place when the size is the same, so stepping through a large volume never puts the volume on the GPU.
    • Keys under <node>.slice.* (axis, index, filter, opaque, overlay_offset); slice.count, slice.position, slice.status and info.* are published.
    • pickRay() meets a world ray with the plane exactly and names the voxel and its value. The slice camera mode (next PR) uses it.
    • Overlay offset: the node's children are its overlays. The quad is pushed back by slice.overlay_offset (a relative polygon offset), so geometry in its plane stays on top.
    • GeometryNode::setTextureInterpolate adds nearest sampling, so voxels draw as squares.
  • Ariadne: type: volume_slice, registered per app by register_cvcgl_extensions (volume_slice_nodes.h). Its transfer function is bound (new tf_binding target volume_slice), so a tf_editor colours it and shows its histogram.
  • pycvc: extract_slice, color_slice, slice_source, the axis helpers and the parameter table.
  • Docs: ARIADNE.md §5.4 and the roadmap's §6.

Tests

  • volume_slice_test, a port test, so it runs natively and in the ports (wasm-mt, node) lane:
    • T2: the axis names, planes and voxels, slices down each axis, colours;
    • T5: bad input;
    • T9: region reads equal the planes of the volume read whole;
    • T6: two apps; two threads against each alone; A then B equals B then A;
    • T8: the table on the state tree.
    • 9/9 pass on Windows and as wasm-mt under node 22.
  • cvcgl_volume_slice, 49 checks, all pass on Windows with CVC_REQUIRE_RENDER=1:
    • realize from a document, live keys, clamping and write-back, status, recolouring, region reads, pickRay, bad input, two apps;
    • offscreen: voxel colours, the nearest filter, and a coplanar overlay drawn on top.
  • test_pycvc_volume_slice.py passes.
  • Still passing: cvcgl_tf_binding, cvcgl_ariadne_realize, cvcgl_ariadne_views, cvcgl_ariadne_pick, cvcgl_texture, cvcgl_tf_editor.

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.
@transfix
transfix enabled auto-merge (squash) November 15, 2026 04:49
…olume-slice-node

# Conflicts:
#	bindings/pycvc/CMakeLists.txt
#	bindings/pycvc/pycvc.i
#	src/cvc/tests/port_tests.cmake
…olume-slice-node

# Conflicts:
#	docs/ARIADNE.md
#	inc/cvc/gl/ariadne/extensions.h
#	src/cvcGL/ariadne/extensions.cpp
@transfix
transfix merged commit 616845e into master Nov 16, 2026
29 checks passed
@transfix
transfix deleted the p7/volume-slice-node branch November 16, 2026 12:04
transfix added a commit that referenced this pull request Nov 16, 2026
transfix added a commit that referenced this pull request Nov 16, 2026
Master's #1249 added volume_slice_test where this branch adds tabs_list_test, at the end of CVC_PORT_TESTS in src/cvc/tests/port_tests.cmake; both are kept.
transfix added a commit that referenced this pull request Nov 16, 2026
…#1305, #1310, #1311)

#1305 gives each Runtime program-lane providers of its own (add_program_intrinsics), so two
documents on one app no longer reach each other's verbs and host functions, and moves
AppRuntime's provider there from the app's list. This branch had split that provider in seven,
each registered on the app with its kind (S1-Q7). Conflicts in ariadne.h, app_runtime.cpp and
ariadne.cpp keep both:

- Runtime::add_program_intrinsics takes a kind too (the form without one is host_only, as
  register_action_intrinsics's), and the Runtime's own list keeps it. AppRuntime adds its seven
  providers there, each with the kind it had, in the same order.
- install_providers runs any list by kind; the Runtime's own run after the app's, by the same
  rules, wherever an env is built: an action, a resident, a spawned child (finish_context), the
  names probe, and init: and a module's init: (every kind as it is, on their own thread).
- host_only_bindings counts the Runtime's own host_only providers, so one that binds anything
  pumps the document's group on the host thread, as an app provider does.
- add_program_intrinsics marks the placement stale, as a late host verb does.
- The own list is read where an env is built, a spawned child's on its pumping worker, so it is
  under a mutex of its own (own_mutex), copied, and run unlocked; names_mutex no longer guards it.

STATE_EXEC_THREADED.md: the Runtime's own providers, AppRuntime's seven among them, and the
fourth late-registration path. Built locally (MSVC Release; AB.lock held the box, so the suites
were not run here); a test of the own providers by kind follows.
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