Skip to content

Automatic recomputation of analysis (1-to-0) can produce unwanted results #341

Description

@StefanoPierini-Codra

Summary

DataLab currently automatically recomputes analysis operations (the
"1-to-0" features such as statistics, FWHM, centroid, peak/contour/blob
detection, etc.) whenever the underlying object changes — e.g. after a ROI
modification, a data transformation, or an object-property edit.

This automatic behavior can surprise the user, silently overwrite results,
and in some cases produce unwanted or misleading results. I propose to
disable the automatic recomputation of analysis features and instead let the
user trigger it explicitly, by extending the existing manual "Recompute"
action
(which today only handles 1-to-1 processing) so that it also
recomputes 1-to-0 analysis features.

Current behavior

Analysis results are recomputed automatically by
BaseProcessor.auto_recompute_analysis()
(datalab/gui/processor/base.py), which is called from several places, notably:

  • after ROI creation / modification / deletion,
  • after in-place data transformations (recompute_1_to_1),
  • after object-property changes (datalab/gui/panel/base.py).

Meanwhile, the manual "Recompute" action
(SignalPanel/ImagePanel.recompute_processing, wired in
datalab/gui/actionhandler.py) only considers objects whose stored parameters
match the 1-to-1 pattern; 1-to-0 analysis features are explicitly filtered
out and are never recomputed on demand.

Problems with the current automatic behavior

  • Unexpected side effects: changing a ROI or an object property silently
    re-runs an analysis and replaces its previous result, without the user asking
    for it.
  • Potentially wrong or meaningless results: after certain edits, the stored
    analysis parameters may no longer be appropriate for the modified data, so the
    auto-recomputed result can be incorrect or misleading.
  • Loss of user control: there is no obvious way for the user to decide
    when an analysis should be refreshed.

Proposed behavior

  1. Remove the automatic recomputation of 1-to-0 analysis
    features. Editing ROIs, data, or object properties would no longer implicitly
    re-run analyses; existing results are simply left as-is (and may be flagged
    as potentially outdated).
  2. Extend the existing manual "Recompute" action so that, in addition to
    1-to-1 processing, it also recomputes 1-to-0 analysis features for the
    selected objects. The user thus refreshes analysis results explicitly, at a
    moment of their choosing, through the same familiar command.

Rationale

  • Recomputation becomes predictable and explicit: results change only when
    the user asks for it.
  • Avoids silently overwriting analysis results with potentially invalid ones.
  • Consolidates all recomputation behind a single, well-known manual action,
    simplifying the mental model.

Affected repository

  • DataLab (DataLab-Platform/DataLab): recompute action, auto-recompute call
    sites, tests, and documentation.

Activity

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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions