Skip to content

fix(shift_variant): restrict partition-of-unity cosine windows to main lobe - #605

Open
chenyangsu wants to merge 1 commit into
Biohub:mainfrom
chenyangsu:fix/shift-variant-window-support
Open

chenyangsu wants to merge 1 commit into
Biohub:mainfrom
chenyangsu:fix/shift-variant-window-support

Conversation

@chenyangsu

Copy link
Copy Markdown

Related issue

None

Summary

In make_partition_of_unity_weights(), cos(pi * (y_um - yc) / width_y_um).clamp(min=0) ** 2 repeats positive lobes every 2 * width, so on an (8, 8) grid over (128, 128) pixels 75% of the center pixel's weight comes from distant tiles outside their window width. For odd shapes, Ny // 2 also places the last pixel on the boundary where every tile weight vanishes.

Could we gate each 1D cosine window to abs(d) < 0.5 and center coordinates with Ny / 2 and Nx / 2? Happy to keep the coordinate centering separate if you prefer.

Testing

pytest tests/models/test_shift_variant_fluorescent_3d.py tests/test_zernike_seidel.py tests/test_benchmark_simulate.py -> 27 passed (8 new cases fail on main), ruff check and ruff format --check clean.

Checklist

  • I added or updated tests, or this change does not require tests.
  • I updated the documentation, or this change does not require documentation.
  • I confirmed this change does not include confidential or sensitive information.

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