Repository navigation
[GUI] Match the pop_dipfit_nonlinear dialog on configured MRI data - #1040
Conversation
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
Claude finished @arnodelorme's task in 1m 15s —— View job Code review
BlockingNone. Important
Nits
Test gaps
EEGLAB parity notes
Checked: the diff against |
| tag = "dip1mom" if action == "flip1" else "dip2mom" | ||
| flipped = -numeric_vector(widgets[tag].text(), dtype=float) | ||
| widgets[tag].setText(" ".join(format(float(value), "g") for value in flipped)) | ||
| widgets[tag].setText(" ".join(f"{float(value):.3f}" for value in flipped)) |
There was a problem hiding this comment.
Important: Flip rounds CTF moments to 3 decimals, even though the dialog shows 6.
This PR shows moments with 6 decimals when coordformat is CTF (lines 84 and 337). This flip branch always formats with .3f, so on a CTF dataset, Flip (in|out) silently drops the last three decimals. On OK, _apply_nonlinear_gui_model parses dip1mom/dip2mom from the widget text, so the rounded moment ends up in EEG.dipfit.model and in the history command. Small CTF moments can round to 0.000.
Suggested fix: use the same precision for flipping. params["eeg"] is already available in this function, so pull the CTF check into one helper and use it in all three places:
def _moment_precision(EEG: dict[str, Any]) -> int:
return 6 if str(dipfit_record(EEG).get("coordformat", "")).upper() == "CTF" else 3precision = _moment_precision(params["eeg"])
widgets[tag].setText(" ".join(f"{float(value):.{precision}f}" for value in flipped))Then add a CTF case to test_nonlinear_ok_keeps_the_flipped_moment: a dataset with coordformat="CTF" and a moment such as 1e-4. It should come back as -0.000100, not -0.000.
|
🤖 Second round on the review above: the Flip precision change is held for Arno's decision. The branch now only carries its fixed parent (#1038, through #1039).
|
|
Arno's decision (email of December 1, 2026): keep EEGLAB's three-decimal rounding of flipped CTF moments, as this branch does (option a). The six-decimal commit is not used. Merged into develop the same day. — orchestrator |
The manual dipole fit now has the native symmetry row, separate fit actions, explicit Cancel, Help and OK row, and MATLAB position, moment and variance precision. The largest vertical offset after the change was 0.50 px. This PR stacks on #1039.
Three nonlinear fits from the same MNI coarse model agreed within 2.38e−7 on the concatenated position, moment and residual variance array. This PR changes display, actions and formatting.
Native captures and verification
The clean jamming capture verified the checkout imports before opening each window. Focused geometry and DIPFIT test results were 210 passed in 4.00s.
Fixes #1004. Part of #875.
Full inventory report for the project team. pop_dipfit_nonlinear (p. 85). PDF · Editable Word.