You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Sad Catapella N7][Scientific correctness] Image summaries can miscount saturated pixels across mixed-dtype Z/T planes #54
Sad Catapella Normalization Batch 7, pinned f784c95e3049483f87466150ffc5764375fa631d. Confirmed source-level numerical/data-contract defect for a synthetic mixed-dtype image; no repository tests executed. Distinct from #51 (mixed RGB FOVs in fit).
Evidence
image_summaries() lines 165–175 checks channel counts but never enforces one dtype across Z/T planes belonging to a single source image.
_summary() lines 178–209 groups all those histograms, assigns the summary's dtype from the first plane's first channel, and uses _saturated_fraction(histograms, ...) for every channel.
One logical source_relative_path='a.tif' with z=0 a uint8 plane whose values are all 100 (no pixel is 255), and z=1 a uint16 plane whose values are all 1000 (no pixel is 65535). Make exact one-value histograms for both. If uint8 is first, the summary's top=255; the uint16 plane's highest occupied singleton bin at 1000 is counted as saturated despite not being at its type maximum. The true saturated fraction is 0 for either plane's native dtype, but the algorithm can report a positive result. Swapping record order changes summary.dtype and behavior.
Fix and acceptance
Refuse mixed dtypes for one logical source image before pooling; report paths, Z/T planes and observed dtypes. Do not auto-convert dynamic ranges or guess bit depths. Optionally require global experiment dtype consistency only at the upstream preprocessing boundary (separate policy). Test both plane orders, uint8+uint16, uint16+int16, same-dtype varying Z/T, one all-nonfinite channel, and saturated type maxima. Ensure saturated fraction does not depend on input row ordering. No Numba opportunity.
Activity
Refuse images whose Z/T planes have different pixel types