Skip to content

[Sad Catapella N6][Scientific data integrity] RGB group fitting silently pools FOVs with incompatible integer pixel dtypes #51

Closed

Description

@guijacquemet

Baseline and classification

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.

Evidence

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions