Improve XY fusion overlap detection by testing multiple z slices#11
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31207a6996
ℹ️ 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".
| '''Load a representative slice from a dataset at the target XY resolution.''' | ||
| yx_res = get_store_attributes(ds)['resolution'][-1] | ||
| target_scale = yx_res / target_res | ||
| img, _ = find_ref_slice(ds, local_z) |
There was a problem hiding this comment.
Constrain slice lookup to the tested overlap
When a sampled slice is blank, find_ref_slice(ds, local_z) searches forward until it finds any non-empty slice in the dataset. For candidates near the end of the shared z range, this can load a slice beyond the overlap (or a different global z in each dataset) and still mark the pair as a valid XY overlap for config['zmin']..config['zmax']; this can generate fuse configs based on image content that is not actually present in the fused interval. The lookup should either read the exact candidate slice or limit the search depth to the candidate's remaining overlap range and verify the returned z.
Useful? React with 👍 / 👎.
Motivation
Description
_candidate_overlap_slices,_load_resampled_ref_slice,_has_valid_xy_overlap, and_format_sift_metricsto select representative z indices, load/resample slices, run multi-slice SIFT checks, and format SIFT diagnostics.create_configs_fused_stacksto call_candidate_overlap_slicesand to test pairwise overlaps by trying several candidate slices before deciding that a pair does not overlap.emalign/align_xy/prep.py(adds ~84 lines, removes ~14 lines) to implement the above behavior.Testing
python -m py_compile emalign/align_xy/prep.pyand it succeeded.git diff --checkand there were no whitespace or diff-check issues.Improve XY fusion overlap detection.Codex Task