Repository navigation
feat: roi overlays ao - #40
Draft
dpshepherd wants to merge 50 commits into
Draft
dpshepherd wants to merge 50 commits into
dpshepherd wants to merge 50 commits into
Conversation
Match processed depths to the first acquired layer using upstream histogram matching. Combine cropped ROI tiles by acquisition depth, retain uint16 histogram bounds, and keep source pixels unchanged. Remove scalar-gain paths and update the associated fixtures, report assertions, CLI help, and documentation together.
Use one unsorted per-channel fit over selected acquisition depths. Remove residual tissue-profile calibration and the maximum of separately normalized depth fits, and invalidate older calibration caches. Retain the existing numerical accuracy targets and validate the full-acquisition worker and saved-field processing paths.
Render the native annotated overview once, then scale the complete image isotropically to the JPEGli encoder limit of 65500 pixels. Write matching PNG and quality-100 4:4:4 JPEG files, preserve physical calibration and source ROI coordinates, and upgrade saved PNG-only overviews without rerendering.
Reuse the unchanged SJS polygon mapping, equal-area subdivision, and intended-center calculations. Add an adapter using production acquisition, AO-plan, registered-footprint and NGFF readers. The SJS script imports these shared calculations.
Add --ao-grid to draw the saved acquisition polygon, nine equal-area cells and intended center stars on the full overview. Preserve display transforms, ROI outlines, physical calibration and the scale bar. Resume can annotate a saved overview without rerendering source tissue.
Keep overlap uploads and downsampling on the GPU while limiting array lifetimes to one pair. Remove grow-only staging buffers and release cached FFT plans and device/pinned scratch between pairs. Add real-CUDA checks for overlap bounds, GPU downsampling and memory release. Require an available CUDA registration backend in the manual GPU workflow. Validation: 78 CPU tests and two focused GPU release cases passed. The broader GPU run was stopped before completion so ROI processing could resume.
Evaluate Padfield moments sequentially with real-valued GPU FFT correlations instead of retaining six full complex spectra. Keep only permitted lags for the final score while preserving the global overlap and variance thresholds. Keep caller image intensities unchanged. ROI_001's sixth pair (positions 227 and 564) has a sampled overlap of 48 x 1364 x 380. Each previously padded complex spectrum occupied about 1.5 GiB, so cleanup between pairs could not prevent the within-pair peak. Add independent normalized-correlation comparisons and a real 512-MiB CUDA workspace case. Static checks passed; CUDA validation is still running.
Use CuPy real FFT operators directly for the sequential masked correlation. Avoid importing cupyx.scipy.signal, which emits an experimental rawkernel warning and prevents backend initialization when warnings are errors. Multiply spectra in place and release the second spectrum before the inverse transform to further reduce the temporary workspace. Validation: CUDA registration imports with warnings treated as errors; formatting and lint checks passed.
Remove the custom sequential masked-correlation implementation and its new tests. Remove the extra full masked NCC pass that allocated multiple 1.5-GiB padded spectra on ROI_001 pair 6. Use the existing cuCIM phase/edge correlation and SSIM path, keeping GPU overlap uploads, block reduction and pair cleanup. Update the registration fingerprint to prevent reusing measurements from the removed masked-correlation path. No unrelated processing is changed. Validation: CUDA backend imports with warnings treated as errors; formatting, lint and diff checks passed. Committed without waiting for GPU tests as requested.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original goal was to automate plotting of ROIs from large samples for manuscript. Found a couple bugs in ROI extraction and fusion, so fixed along the way.