Repository navigation
Conversation
…adient_vector_diffusion, seed_mode::critical_points, critical_point_seeds Phase P6 of docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md (§5 steps 3-4), the core: - cvc::gradient_vector_diffusion (inc/cvc/volume/gradient_vector_diffusion.h): SegMed's gvfflow (Eqs. 2-3 of Bajaj, Yu and Auer 2003) as a sliced stepper, a voxel update per unit, with its job and parameter table; the weighing field is a parameter (the field being diffused, the paper's and SecStruct's, or the initial one, SegMed's). cvc::critical_point_at classifies a voxel of a field by SegMed's 26-neighbour test. Shared, for SecStruct, SegMonomer and the §2.3 skeletons. - seed_mode::critical_points: the critical points of the diffused gradient field as two classes after the point classes, "feature" (maxima) and "background" (minima), with the paper's §4 thresholds (cp_feature_threshold, cp_background_threshold) and SegMed's choices as parameters (cp_field, cp_weights, cp_sample). They are seeded in genseg_context's "seeding" phase, before the user's seeds (which win a shared voxel); the point classes may be empty. The default stays local_maxima (§5 step 5 switches it later). - cvc::critical_point_seeds, critical_point_seeds_stepper and critical_point_seeds_job. - param_table: enum names also read with '-' for '_' (critical-points). - SegMed audit in the roadmap's §1.3 table: GVF_Compute returns at GVF.cpp:97, so its diffusion and critical points never ran; Segment marches from 13 seeds hard-coded for one heart dataset. - tools/volrover-goldens: a segmed library (the dead code built with the early return patched out), four cases, goldens of the critical list and the diffused field. Tests (port_tests.cmake and SAN_CXX_TESTS): gradient_vector_diffusion_test (T2-T8) and critical_points_test (T1: the field bit for bit and the critical lists point for point against SegMed on all four cases; T3-T8). segmentation_test's six GenSeg goldens still match.
transfix
enabled auto-merge (squash)
November 16, 2026 02:18
…s hidden until part 2 pycvc's %include of segmentation.h wrapped critical_point_seeds_job, whose result_job<point_classes> SWIG could not name, and seeded_segmentation_params' cp_weights, a diffusion_weights it knew nothing of. GCC and clang (tsan, ariglx-web) failed on the generated code. pycvc_segmentation.i now includes gradient_vector_diffusion.h for its enums and ignores critical_point_seeds, its stepper and its job; part 2 wraps them.
…aper-mode-core # Conflicts: # src/cvc/tests/port_tests.cmake
transfix
added a commit
that referenced
this pull request
Nov 17, 2026
…ds, their DSL, CLI and pycvc surfaces, and VolUtils' seed generators (#1292) Both parts of P6 (docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md, section 5 steps 3-4) in one squash: #1292 was stacked on #1291 and carries its commits. Part 1 (#1291): cvc::gradient_vector_diffusion (stepper, job, parameter table), critical_point_at, seed_mode::critical_points and critical_point_seeds (stepper, job), with SegMed goldens (T1), gradient_vector_diffusion_test, critical_points_test and the SegMed audit in the roadmap. Part 2: segment.critical-points (-async, -start), cvc segment --automatic critical-points, pycvc critical_point_seeds(_job), and #123's capsid_critical_points and rotated_seeds (cvc capsid-seeds, cvc rotate-seeds, pycvc), with seed_generators_test. No CI job added or renamed; ci.yml's SAN_CXX_TESTS line gains the three tests. Refs #123.
Owner
Author
|
Landed in master as part of #1292's squash (4268c0e): #1292 was stacked on this branch and carried all of its commits. This PR's last blocker was |
auto-merge was automatically disabled
November 17, 2026 07:21
Pull request was closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
P6 part 1 of docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md (§5 steps 3-4): GenSeg's automatic seeding as the paper describes it (Bajaj, Yu and Auer, JSB 2003). It diffuses the gradient field and seeds the feature and background classes from its critical points. The default stays
local_maxima; §5 step 5 decides the switch later.What lands
cvc::gradient_vector_diffusion(inc/cvc/volume/gradient_vector_diffusion.h): SegMed's gvfflow, the paper's Eqs. 2-3, as a shared sliced stepper. A unit is one voxel update. It comes withgradient_vector_diffusion_joband a parameter table (iterations,k,weights,normalize).weightspicks the field the angles come from:current(the field being diffused, as the paper and SecStruct do) orinitial(SegMed's).cvc::critical_point_atclassifies a voxel with SegMed's 26-neighbour test.seed_mode::critical_points(inc/cvc/volume/segmentation.h): the critical points of the diffused field become two classes after the point classes,feature(maxima) andbackground(minima).cp_feature_threshold,cp_background_threshold).cp_field(image, the paper's f = I; orgradient_magnitude, SegMed's),cp_weightsandcp_sample(SegMed's 1-in-21 thinning; 0 keeps every critical point).cp_iterationsandcp_k.genseg_context'sseedingphase, before the user's seeds, which win a shared voxel. The point classes may be empty.cvc::critical_point_seeds,critical_point_seeds_stepperandcritical_point_seeds_job: the seeds alone, aspoint_classes, with a slicedseedingphase.param_table: enum names also read with-for_(critical-points).GVF_Computereturns at GVF.cpp:97 right after the initial field, so its diffusion, critical points and clustering never ran.Segmentignores the critical list and marches from 13 voxels hard-coded for one heart dataset.exit()s inread_dataandgvfflow, andwrite_datawriting six fixed names into the current directory.tools/volrover-goldensgets asegmedlibrary: the dead code built with that early return patched out at configure time (as Skeletonization's patch is done), plusread_data'sfopen "r"changed to"rb". It has four cases with goldens of the diffused field and the critical list.Parity (T1)
critical_points_test'sMatchSegMedruns SegMed's settings (cp_field = gradient_magnitude,cp_weights = initial,cp_sample = 20). The diffused field matches bit for bit, all 24000 components on each case. The critical lists match point for point, natively and under node:many_blobsplateaunoisy_blobnoisy_slabThe legacy
exp()isexpf, sovolrover goldensCI compares the field to 1e-6 on Linux. It compares the list byte for byte.Tests (§1.7 rows)
gradient_vector_diffusion_test(11 tests):critical_points_test(16 tests):cvc::apps in one process;segmentation_test's six GenSeg goldens from P5 still match. ItsParameterTabletest now expects the new fields and the thirdseed_modechoice.Both tests are in
port_tests.cmake(theports (wasm-mt, node)lane) and inSAN_CXX_TESTS. No CI job is added or renamed. ci.yml changes on one line and keeps its CRLF line endings.Findings
SegMed differs from the paper in four ways:
tlow;All four are parameters: the defaults follow the paper, and SegMed's values reproduce SegMed.
The 26-neighbour test marks the whole 3x3x3 block around an extremum. SegMed's thinning keeps that block's first voxel, a corner. On a steep peak that corner's step cost is past
MAX_TIME, so its front never moves. So the paper mode defaults tocp_sample = 0.P5's "fronts stop at steep flanks" applies here too. On two sigma-2.5 blobs the feature class gets only the cores (123 voxels), and the background floods the rest. The default switch (§5 step 5) needs real maps and probably a rethink of gamma.
Rules
tools/singleton_scanis unchanged, with no allowlist line.tools/volrover-goldens, from a pinned volrover clone, and are never vendored.git-clang-formatwas run on the changed lines only.Next
Part 2 (stacked on this branch):
segment.critical-pointswith-async/-start,cvc segment --automatic critical-pointswithout a seeds file, pycvccritical_point_seeds, and #123's seed generators.Refs #123.