Skip to content

Calibration GUI: expose Sortgrid search radius in Edit calibration parameters - #47

Merged
alexlib merged 3 commits into
mainfrom
copilot/fix-sortgrid-search-radius-gui
Nov 24, 2026
Merged

alexlib merged 3 commits into
mainfrom
copilot/fix-sortgrid-search-radius-gui

Conversation

@alexlib

@alexlib alexlib commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

The Sortgrid search radius (sortgrid.radius, px) could only be changed by hand-editing parameters_*.yaml. The calibration window reads the YAML only when it is created, so edits were ignored until the window was reopened.

Changes (src/openptv2/gui/parameter_gui.py)

  • Dialog field: adds sortgrid_radius ("Sortgrid search radius (px)") next to "Size of crosses".
  • Load: the field is populated from pm.parameters["sortgrid"]["radius"]. A missing or 0 value falls back to 5, matching the or 5 fallback in calibration_gui._button_sort_grid_fired.
  • Save: on dialog close the value is written to experiment.pm.parameters["sortgrid"]["radius"], creating the sortgrid section if it is absent.

_button_sort_grid_fired already reads sortgrid.radius from the parameter manager on every click. A new value should therefore apply on the next Sortgrid click without reopening the window.

Not changed

"Load images/parameters" still does not re-read the YAML. Doing so would risk discarding in-memory state that has not been saved yet, such as man_ori_coordinates. The dialog field removes the need to edit the YAML by hand.

Review notes

  • I did not run the test suite (uv/pytest were unavailable in my environment) and added no tests. I only confirmed the module compiles.
  • I wrote this from the issue text rather than applying the attached patch. The one deliberate difference is the default of 5 instead of the patch's 15, to match the existing fallback.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@alexlib alexlib changed the title [WIP] Fix GUI to allow setting Sortgrid search radius Calibration GUI: expose Sortgrid search radius in Edit calibration parameters Nov 24, 2026
…parameters and YAML, reload, cancel

The dialog value is the one calibration_gui reads on each Sortgrid click
(experiment.get_parameter('sortgrid')), checked here through the real
CalHandler and the saved YAML.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@alexlib
alexlib marked this pull request as ready for review November 24, 2026 22:09
Copilot AI balanced review requested due to automatic review settings November 24, 2026 22:09
@alexlib
alexlib merged commit df86807 into main Nov 24, 2026
13 of 15 checks passed
@alexlib
alexlib deleted the copilot/fix-sortgrid-search-radius-gui branch November 24, 2026 22:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

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.

Calibration GUI: Sortgrid search radius cannot be set from the GUI (only via YAML, and not picked up on reload)

3 participants