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 N6][Scientific data integrity] RGB group fitting silently pools FOVs with incompatible integer pixel dtypes #51
Normalization Batch 6 at f784c95e3049483f87466150ffc5764375fa631d. Confirmed missing cross-record dtype constraint; whether a library-level guard is required is a scientific API ownership decision because preprocessing currently enforces experiment-wide dtype consistency. No package tests executed.
fitting.fit() lines 357–395 accepts records with the same channel count, calls check_rgb(channel_count, _dtypes(items)) then pools all R/G/B intensity distributions.
The normalization contract assigns experiment-wide dtype validation to preprocessing, but the public fit API is independently callable. RGB tests sample one dtype per test, not mixed types.
Deterministic fixture and impact
Create two valid PlaneRecord objects for different FOVs, each three-channel: one RGB uint8 with channels around 100–200, another RGB uint16 with channel values around 20,000–50,000; call fit([row8,row16], NormalizationSettings(image_type='rgb', scope='biological_repeat')). All samples are pooled into one shared reference as though they had comparable units/dynamic ranges. The result's quantiles and applied normalization can be dominated by the 16-bit FOV; no dtype inconsistency is reported.
Fix / acceptance
Decide whether the normalization library should enforce one dtype for every plane in an RGB fit (recommended), or require a prevalidated typed group descriptor and explicit caller proof. Never silently convert mixed dynamic ranges; do not infer/scalewise reconcile bit depth. Report conflicting source FOVs and dtypes before pooling. Regress single uint8, single uint16, mixed 8/16, mixed signed/unsigned 16, diverse yet equally typed image sizes and multi-timepoint grouping. Also assess whether this check should apply to fluorescence fit as a separate policy, keeping ownership with the relevant experimental contract. Benchmark error preflight overhead, negligible compared with histogram pooling. No Numba role.
Activity
Refuse RGB groups whose images have different pixel types before pool…
Move the RGB input checks into rgb.py, within the code-rule limits (#51…