Conversation
…shold sweep QC report Agent-Logs-Url: https://github.com/khanlab/SPIMquant/sessions/6e50e573-7300-48e8-9c59-9808da92d8f5 Co-authored-by: akhanf <11492701+akhanf@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
akhanf
April 4, 2026 23:04
View session
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.
The multiotsu histogram used a hardcoded intensity range [0, 1000] with 1000 bins, which breaks on datasets with different dynamic ranges. This replaces those fixed parameters with a percentile-based range and bin-width approach, and adds an optional target rule to visually optimize the threshold.
Parameter changes
--seg_hist_range→--seg_hist_percentile_range(default:[1, 99], type: float) — range adapts to each dataset--seg_hist_bins→--seg_hist_bin_width(default:1, type: float) — bin count derived asceil((range_hi - range_lo) / bin_width)multiotsu.pyupdatesLoads a downsampled pyramid level (tries levels 5→1) to compute percentiles efficiently, then uses the resulting range and bin width to build the histogram before running multi-Otsu thresholding.
New:
all_otsu_hist_qctarget ruleInvoke to produce one self-contained HTML report per subject/stain/method:
Each report contains:
multiotsurule)This allows visual inspection to pick the best threshold before committing to a full segmentation run. The rule reuses the bias-field corrected zarr already produced for the
multiotsurule (temp file kept alive until both consumers finish).