-
Notifications
You must be signed in to change notification settings - Fork 7
Non-integer focus support #473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Change z_focus_offset type from Union[int, Literal["auto"]] to Union[float, Literal["auto"]] - This enables sub-pixel precision for focus offset values in 2D phase reconstruction - Addresses issue #470 for coarsely sampled slice improvements 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add enable_subpixel_precision parameter (default False for backward compatibility) - Use polynomial derivative analysis to find continuous extrema when enabled - Return float focus indices when sub-pixel precision is enabled - Update plotting function to handle float indices via interpolation - Enhance docstring with new parameter and return type information This enables more accurate focus detection for coarsely sampled data by finding focus positions between discrete slice indices. Addresses issue #470. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- test_subpixel_precision: Validates float focus detection with synthetic data - test_subpixel_precision_backward_compatibility: Ensures default behavior unchanged - test_subpixel_precision_with_plotting: Tests plotting with float indices - test_z_focus_offset_float_type: Validates settings accept float z_focus_offset - test_position_list_with_float_offset: Tests position calculation pipeline All tests verify both functionality and backward compatibility. Ensures robust implementation of issue #470 requirements. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
@talonchandler one thing that might help in the documentation is selecting a reasonable polynomial fit order if subpixel_precission is set to True. I saw in your tests that 4 is a good default? |
Good suggestion. @gav-sturm, for your use case I suggest starting with order=2, then increasing to 3 or 4 if you're unhappy with the fits you're seeing in the plots. If this suggestion works well, I'll add it to the docstring. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #473 +/- ##
==========================================
+ Coverage 36.55% 38.11% +1.56%
==========================================
Files 49 49
Lines 10186 9791 -395
==========================================
+ Hits 3723 3732 +9
+ Misses 6463 6059 -404 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixes #470.
Enables sub-pixel precision for focus detection and
z_focus_offsetvalues, improving 2D phase reconstructions for coarsely sampled data.Changes:
z_focus_offsetnow accepts float values (previously int only)focus_from_transverse_band()enable_subpixel_precision: bool = FalseOld usage (unchanged):
New usage:
Config files now support float offsets: