Add SBEM stage-position XY alignment option#14
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bdfceee626
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for (x, y), (origin_y, origin_x) in tile_origins.items(): | ||
| right = (x + 1, y) |
There was a problem hiding this comment.
Fix stage-offset axes for SBEM tile keys
When this option is used through sbem_image, tile_origins is keyed by parse_yx_pos_from_name, which returns (row, col) (for example the SBEM tests expect an upper-right tile at (0, 1)). This loop unpacks those keys as (x, y), so a real right neighbor at (0, 1) is treated as down and its horizontal stage delta is written into cy instead of cx, producing a transposed/incorrect coarse mesh for SBEM rows with more than one tile. Convert the SBEM keys to the internal (x, y) convention before applying stage offsets, or unpack/index them consistently as (y, x) here.
Useful? React with 👍 / 👎.
Motivation
Description
--use-sbem-stage-positionsprep-config flag (persisted tomain_config.json) and validate it is only used with--mode sbem_imageinprep_config_xy.py.imagelist_*.txt, exposeget_stage_origin_from_nameandget_stage_originsinemalign.io.sbem_image.get_coarse_offsetinemalign.align_xy.stitch_ongridto accepttile_originsand apply them via_apply_tile_origin_offsetsto convert stage-origin deltas into SOFIMA neighbor offsets.align_stack_xycomputes pixel-spacetile_originsfrom stage origins whenuse_stage_positionsis enabled and only allows this insbem_imagemode.tests/test_sbem_image.pyand a conversion testtests/test_sbem_stage_offsets.pyfor_apply_tile_origin_offsets.Testing
PYTHONPATH=. pytest -q tests/test_sbem_image.py tests/test_sbem_stage_offsets.pyand all tests passed (8 passed).PYTHONPATH=. python -m py_compile emalign/io/sbem_image.py emalign/align_xy/stitch_ongrid.py emalign/scripts/align_stack_xy.py emalign/align_dataset_xy.py emalign/prep_config_xy.py, which succeeded.Codex Task