Skip to content

[Sad Catapella B9][Scientific reporting] Group statistics silently pool distinct fluorescence channels and mislabel channel measurements as planes #104

Closed

Description

@guijacquemet

Source baseline and classification

Final Batch 9, pinned d7a538e56d41ac1093ba79adcad397c21b3dfd32. Confirmed current implementation/contract behavior; the scientific suitability of pooled channels requires an explicit decision, not an assumption that this is an accidental regression. No tests executed.

Evidence

  • report.group_summaries() lines 268–306 feeds channel_histograms() lines 309–316 to a single PooledHistogram across every channel of every plane; the result reports one minimum/mean/median/percentiles per biological group, without a channel dimension.
  • plane_count=len(histograms) labels the number of per-channel histograms as 'planes'; two spatial Z/T planes with three fluorescence channels display 6 planes although there are two XYC planes. The docstring acknowledges the historical convention, but the output field is ambiguous.
  • distribution_png() lines 3147–3175 constructs the same all-channel aggregate for optional grouped intensity curves.
  • tests/test_report.py lines 125–149 codifies the pooled-channel behavior. The README example correctly pools one channel for actual normalization, demonstrating that the optional report differs from the downstream normalization semantics.
  • In a two-channel fluorescence image with all C0 pixels near 10 and all C1 near 1000, a mixed-channel mean near 505 is not representative of either biomarker. Mix changes in channel gains, exposure or number of channels can change the pooled summary without biological change in the channel being interpreted.

Scientific impact

Optional group statistics and curves can be mistaken for channel-specific fluorescence differences; the reported 'planes' count also exaggerates spatial samples. This does not show corruption of the stored histogram table or downstream normalization, which retain separate channel columns.

Fix / acceptance

Make per-channel summary and distribution the default for fluorescence: return explicit channel key or channel-specific rows (or a chosen channel selector in Step 4), preserve per-condition/repeat identity, and report xyc_plane_count separately from channel_histogram_count. If intentionally keeping all-channel aggregation for RGB or legacy mode, label it clearly as a deliberate aggregate. Add 2–4 channel fluorescence regressions, strongly separated channel distributions, different channel dynamic ranges, no-finite-pixel channel, RGB, and backward compatibility tests. Keep histogram pooling algorithms in normalization; preprocessing owns only the reporting grouping policy. Performance benchmark: avoid repeated pooling per UI selection; issue #97 covers caching.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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