Add CPD parameter tuning grid search#58
Open
Marei33 wants to merge 4 commits into
Open
Conversation
Collaborator
Author
|
solves #42 |
Optuna GridSampler-based grid search over CPD non-rigid registration parameters (w, beta, lmd, maxiter), evaluated by mean Landmark Registration Error (LRE) between corresponding landmarks. - matchmaker/cpd_parameter_tuning/: optimization, landmark embedding, dataset-specific beta-range suggestion, defaults and README - workflows/cpd_optimization.smk: input_to_n5 -> add_landmarks -> prealignment_with_lm -> rigid_alignment_with_lm -> optimize_cpd - examples/cpd_optimization_config.yaml: example config (nest axis_orientation under prealignment to match the workflow/registration config convention) - matchmaker/utils/vis.py: add plot_landmark_qc and a title param for visualize_displacement_field (used by the tuning trial plots) - environment.yml: enable optuna Stacked on the visualisation branch (#57), which provides the PINK/CYAN colormaps that add_landmarks imports. Target branch: dev. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Point the example usage at examples/cpd_optimization_config.yaml (not the cluster-specific data/brain_matching path) - Generalize dataset-specific names (Igor/Seymour) and example paths - Describe landmarks as labeled spheres, not single-voxel labels - Fix a stray/unclosed backtick in the dataset-specific section Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
50ab1a6 to
63b993c
Compare
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.
Adds a standalone Optuna
GridSampler-based grid search for tuning CPD (Coherent Point Drift) non-rigid registration parameters. Each parameter combination is scored by the mean Landmark Registration Error (LRE), the average distance (µm) between corresponding anatomical landmarks after CPD registration.Tuned parameters:
w(outlier weight),beta(Gaussian kernel width),lmd(regularization strength).How it works
New Snakemake workflow
workflows/cpd_optimization.smk, separate from the main registration pipeline:input_to_n5→add_landmarks→prealignment_with_lm→rigid_alignment_with_lm→optimize_cpdbetaranges from point spacing / extent (suggest_cpd_ranges.py).best_cpd_params.yaml(drop-in for the registration config).Search space is configurable:
default,dataset-specific, or an explicit dict in the config.Contents
matchmaker/cpd_parameter_tuning/—cpd_optimization.py,add_landmarks.py,suggest_cpd_ranges.py, default param/range YAMLs, READMEworkflows/cpd_optimization.smkexamples/cpd_optimization_config.yamlmatchmaker/utils/vis.py— addsplot_landmark_qc(landmark QC plot) and atitleparam forvisualize_displacement_field(used by trial plots)environment.yml— enablesoptunaNotes
Merge #57 and #56 first.