Repository navigation
segment.critical-points, cvc segment --automatic critical-points, pycvc critical_point_seeds, and VolUtils' seed generators (P6 part 2) - #1292
Merged
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.
…vc critical_point_seeds, and VolUtils' seed generators (P6 part 2) Phase P6 of docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md, the surfaces (§5 steps 3-4), on top of part 1: - DSL: segment.critical-points (+ -async / -start), cvc::critical_point_seeds behind the generic job forms of cvc/core/job_intrinsics.h, registered beside segment.seeded (critical_point_seeds_op, key cvc.segment); the result is a point_classes data object (feature, background). segment.seeded with "automatic" "critical_points" takes empty classes. - CLI: cvc segment --automatic critical-points (or critical_points) runs with no seeds file; the --cp-* flags come from the table. cvc capsid-seeds and cvc rotate-seeds write point classes. - pycvc: critical_point_seeds(vol, **kw), critical_point_seeds_job, capsid_critical_points, rotated_seeds, and the capsid_seed_params / rotation_seed_params classes. - Seed generators (#123's VolUtils leftovers; sources at volrover edabb85^): cvc::capsid_critical_points (criticalPntsToSeed, SegSubunit's FindCriticalPoints: maxima kept for the capsid's T-number, plus the gradient magnitude's maxima when they are few), a sliced stepper with its job; cvc::rotated_seeds (SeedProduce, SeedProduceRegardingAxis: N-fold rotational copies about an axis), inc/cvc/volume/seed_generators.h with parameter tables. Tests: segmentation_intrinsics_test (T10: segment.critical-points in its three forms, cooperative and threaded; segment.seeded with no classes), cvc_cli_test (T12: SegmentAutomaticCriticalPoints*, CapsidSeedsAndRotateSeeds), test_pycvc_segmentation.py (T11), seed_generators_test (new, in the ports lane and SAN_CXX_TESTS: the legacy definitions, the stepper, threads, tables; no T1, as VolUtils left volrover's master before the pinned commit).
# Conflicts: # bindings/pycvc/pycvc_jobs.i
…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.
# Conflicts: # bindings/pycvc/pycvc_segmentation.i
…aper-mode-core # Conflicts: # src/cvc/tests/port_tests.cmake
# Conflicts: # src/cvc/tests/port_tests.cmake
transfix
added a commit
that referenced
this pull request
Nov 17, 2026
One conflict, in ci.yml's SAN_CXX_TESTS: this branch added stream_test, net_ws_client_test and ariadne_host_test to the sanitizer legs' list, and #1292 added gradient_vector_diffusion_test, critical_points_test and seed_generators_test (reflowing the lines). Kept both. ci.yml's line 1271 (the arigl-web path filter's files.h/files.cpp line) also goes back to master's bytes: master stores ci.yml with CRLF but that one line LF-only, and an earlier merge here had given it a CR, a whitespace-only change in this PR's diff.
transfix
added a commit
that referenced
this pull request
Nov 20, 2026
P6 moved segment_seeded's input read into genseg::read_voxels (critical_points.cpp), which segment_seeded, critical_point_seeds and capsid_critical_points share. The threaded read moves there with it: read_voxels hands the context the app's compute pool once the volume holds two pieces, and reads in pieces (the first non-finite voxel still the first in order, the same messages). genseg.cpp keeps both includes; segmentation_test keeps GroELAsTheLegacyLibrary next to #1303's real-map tests.
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 2 of docs/roadmap/VOLROVER-LIBRARY-PORTS-ROADMAP.md (§5 steps 3-4): the surfaces of the paper's automatic seeding, plus the seed generators from VolUtils (#123).
Stacked on part 1 (#1291). Until that PR lands, this diff includes part 1's commits. After it lands,
origin/masterwill be merged in here, and the diff will be this part's changes alone. Please review it after that.What lands
segment.critical-points, with-asyncand-start.cvc::critical_point_seedsbehind the generic job forms ofcvc/core/job_intrinsics.h.segment.seeded(critical_point_seeds_op, keycvc.segment).point_classesdata object with the classesfeatureandbackground.segment.seededwith"automatic" "critical_points"accepts empty classes.cvc segment --automatic critical-points(orcritical_points) runs with no seeds file. The--cp-*flags come from the parameter table.cvc capsid-seedsandcvc rotate-seedswrite point classes.rotate-seeds --from cut.rawivrotates seeds marked on a cut of the volume into the whole volume, asSeedProducedid.critical_point_seeds(vol, **kw),critical_point_seeds_job,capsid_critical_pointsandrotated_seeds;capsid_seed_paramsandrotation_seed_params;gradient_vector_diffusion.h.inc/cvc/volume/seed_generators.h, with tables inseed_generators_params.h). The sources are cvc-cli: absorb remaining VolUtils capabilities (from closed volrover#4 salvage audit) #123's VolUtils at volroveredabb85^.cvc::capsid_critical_pointsportscriticalPntsToSeedand SegSubunit'sFindCriticalPoints. It keeps the bright local maxima the capsid's T-number calls for, plus the gradient magnitude's maxima when those are few. It is a sliced stepper (checking,normalising,maxima,saddles) with a job.cvc::rotated_seedsportsSeedProduceandSeedProduceRegardingAxis: N-fold rotational copies of seeds about an axis, each landing on the nearest voxel of the target volume. Class n holds the n-th rotation, namedClass nin the legacy colours.Tests (§1.7 rows)
T10,
segmentation_intrinsics_test(cooperative and threaded):CriticalPointsInTheThreeForms(plain,-async,-start) andSegmentSeededWithCriticalPointsNeedsNoClasses.T11,
test_pycvc_segmentation.py:test_the_papers_automatic_modeandtest_the_seed_generators.T12,
cvc_cli_test:SegmentAutomaticCriticalPointsNeedsNoSeedsandCapsidSeedsAndRotateSeeds.seed_generators_test(new, 10 tests):There is no T1 for the seed generators: VolUtils left volrover's master (app: use this->uniqueThreadKey() inside startThread<T> (no singleton self-reach) #19,
edabb85) before the commit the goldens are pinned to.seed_generators_testis inport_tests.cmakeandSAN_CXX_TESTS. No CI job is added or renamed. ci.yml changes on one line and keeps its CRLF line endings.Legacy bugs not ported
SeedProduceRegardingAxisadded y into the axis centre's z.SeedProduceused pi = 3.1415926 and rounded with(int)(x + 0.5), which is wrong for negative x. The port uses the exact pi andfloor(x + 0.5).Rules
tools/singleton_scanis unchanged, with no allowlist line.git-clang-formatwas run on the changed lines only.Refs #123.