Skip to content

Fix CMC consensus pose estimation and refinement - #237

Merged
cfs-data merged 12 commits into
mainfrom
cmc-consensus-fixes
Aug 25, 2026
Merged

Fix CMC consensus pose estimation and refinement#237
cfs-data merged 12 commits into
mainfrom
cmc-consensus-fixes

Conversation

@cfs-data

@cfs-data cfs-data commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Consensus algorithm fixes

  • Apply the correlation threshold as a post-filter, like the median classifier does.

  • Fixed _refine to return the updated inlier set and criterion instead of None.

  • Fixed the consensus rotation sign, which was negated relative to the median classifier.

  • Fixed the consensus translation, which was only valid at the fit centroid. Added get_translation_about to express it around the reference center, and dropped ConsensusParameters.translation.

  • Fixed the single-CMC pose, which took cells[0] instead of the congruent cell.

  • Fill cell.meta_data, which was left at its defaults. Moved wrap_angles to utils.py and wrapped the consensus angle residual too.

  • Report NaN for the pose if no consensus geometry

@cfs-data
cfs-data requested a review from vergep August 20, 2026 06:12
@cfs-data cfs-data changed the title Fix CMC consensus pose estimation and refinement [WIP] Fix CMC consensus pose estimation and refinement Aug 20, 2026
@cfs-data
cfs-data changed the base branch from main to cmc-cosmetics August 20, 2026 06:51
@cfs-data cfs-data changed the title [WIP] Fix CMC consensus pose estimation and refinement Fix: CMC consensus pose estimation and refinement Aug 20, 2026
@cfs-data cfs-data changed the title Fix: CMC consensus pose estimation and refinement Fix CMC consensus pose estimation and refinement Aug 20, 2026
Comment thread packages/scratch-core/src/conversion/surface_comparison/cmc_consensus/pipeline.py Outdated
Comment thread packages/scratch-core/src/conversion/surface_comparison/cmc_consensus/pipeline.py Outdated
Comment thread packages/scratch-core/src/conversion/surface_comparison/cmc_consensus/pipeline.py Outdated
Comment thread packages/scratch-core/src/conversion/surface_comparison/cmc_consensus/pipeline.py Outdated
Comment thread packages/scratch-core/src/conversion/surface_comparison/cmc_consensus/pipeline.py Outdated
@cfs-data
cfs-data requested a review from vergep August 25, 2026 07:01
@cfs-data
cfs-data changed the base branch from cmc-cosmetics to main August 25, 2026 07:05
@github-actions

Copy link
Copy Markdown

Diff Coverage

Diff: origin/main..HEAD, staged and unstaged changes

  • packages/scratch-core/src/conversion/surface_comparison/cmc_classification_median.py (100%)
  • packages/scratch-core/src/conversion/surface_comparison/cmc_consensus/criterion.py (100%)
  • packages/scratch-core/src/conversion/surface_comparison/cmc_consensus/pipeline.py (100%)
  • packages/scratch-core/src/conversion/surface_comparison/cmc_consensus/procrustes.py (100%)
  • packages/scratch-core/src/conversion/surface_comparison/utils.py (100%)

Summary

  • Total: 46 lines
  • Missing: 0 lines
  • Coverage: 100%

@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Health
. 96% 92%
computations 93% 70%
container_models 99% 100%
conversion 93% 88%
conversion.export 99% 90%
conversion.filter 97% 89%
conversion.likelihood_ratio 97% 86%
conversion.preprocess_impression 97% 86%
conversion.preprocess_striation 90% 62%
conversion.profile_correlator 96% 81%
conversion.surface_comparison 98% 84%
conversion.surface_comparison.cell_registration 98% 89%
conversion.surface_comparison.cmc_consensus 100% 100%
extractors 97% 75%
mutations 100% 100%
parsers 97% 50%
parsers.patches 89% 60%
plots 98% 91%
plots.comparison 100% 100%
plots.likelihood_ratio 100% 100%
preprocessors 98% 83%
processors 97% 72%
renders 99% 50%
utils 92% 100%
Summary 97% (3763 / 3867) 86% (455 / 526)

Minimum allowed line rate is 50%

@cfs-data
cfs-data merged commit 2c150f1 into main Aug 25, 2026
4 checks passed
@cfs-data
cfs-data deleted the cmc-consensus-fixes branch August 25, 2026 07:53
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.

2 participants