Skip to content

fix(interactive): infer KTool guideline delta sign - #551

Merged
kmnhan merged 1 commit into
mainfrom
agent/fix-ktool-guideline-delta-sign
Aug 13, 2026
Merged

fix(interactive): infer KTool guideline delta sign#551
kmnhan merged 1 commit into
mainfrom
agent/fix-ktool-guideline-delta-sign

Conversation

@kmnhan

@kmnhan kmnhan commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Infer a guideline-derived delta sign from the axes configuration and displayed axis order.
  • Use rotation guidelines only when the first two displayed axes are alpha and beta, in either order.
  • Apply a configuration selected in the KTool prompt without changing explicit initial_delta values.
  • Keep the source data unchanged when configuration is selected or the prompt is canceled.

Root cause

ImageTool guideline angles follow display-axis direction. KTool delta follows an axes-configuration convention. The previous handoff always negated the guideline angle before a missing configuration was resolved. Type 2 configurations and reversed alpha-beta display order could therefore produce the wrong sign.

Validation

  • uv run pytest tests/interactive/test_kspace.py - 137 passed with PyQt6.
  • uv run pytest tests/interactive/imagetool/test_imagetool.py -k 'open_in_ktool' - 7 passed with PyQt6.
  • Focused guideline tests - 16 KTool tests and 2 ImageTool tests passed with PySide6.
  • uv run mypy src
  • uv run ruff check
  • uv run ruff format --check
  • git diff --check

Infer the delta sign from the axes configuration and the displayed alpha-beta axis order. Resolve missing configurations after user selection without changing explicit delta inputs.
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.93%. Comparing base (e2cfcc0) to head (76fe54f).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
.../erlab/interactive/imagetool/_kspace_conversion.py 85.71% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #551   +/-   ##
=======================================
  Coverage   91.92%   91.93%           
=======================================
  Files         250      250           
  Lines       98764    98776   +12     
  Branches    16604    16608    +4     
=======================================
+ Hits        90793    90805   +12     
- Misses       4580     4581    +1     
+ Partials     3391     3390    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@kmnhan
kmnhan marked this pull request as ready for review August 13, 2026 02:29
@kmnhan
kmnhan merged commit 4cf838c into main Aug 13, 2026
25 of 26 checks passed
@kmnhan
kmnhan deleted the agent/fix-ktool-guideline-delta-sign branch August 13, 2026 02:30
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.

1 participant