Skip to content

feat(processing): add live previews and brightness/contrast - #368

Merged
ThomasMalletCodra merged 7 commits into
developfrom
feat/live-processing-preview
Sep 29, 2026
Merged

ThomasMalletCodra merged 7 commits into
developfrom
feat/live-processing-preview

Conversation

@PierreRaybaut

Copy link
Copy Markdown
Contributor

Summary

  • Add transactional live previews to compatible 1-to-1 signal and image parameter dialogs.
  • Run speculative computations in an isolated process, discard stale results, and retain at most one idle executor between dialogs.
  • Reuse a completed current preview when accepting a single-source operation while preserving normal multi-selection behavior.
  • Add automatic numeric sliders to processing forms and integrate the new brightness and contrast operation.

Integration

Depends on:

Before merge

  • Raise the minimum dependencies to the released guidata and Sigima versions containing the upstream APIs.
  • Move the new release notes from the already published 1.3 cycle to the next DataLab release.

Validation

Focused preview, brightness/contrast, and plugin integration tests: 31 passed.

Preview one selected source without publishing temporary results.
Keep cancellation transactional and process the original selection
after confirmation.
@PierreRaybaut

Copy link
Copy Markdown
Contributor Author

CI tests are failing only because this PR needs the changes implemented in this guidata PR.

@PierreRaybaut
PierreRaybaut marked this pull request as ready for review September 10, 2026 07:35
@ThomasMalletCodra ThomasMalletCodra added this to the V1.4.0 milestone Sep 10, 2026
ThomasMalletCodra and others added 2 commits September 10, 2026 18:30
The "Brightness and contrast" and "Live processing preview" entries were
added to the v1.3 release notes, but these features target v1.4.0.

* Add doc/release_notes/release_1.04.md with both sections
* Remove them from doc/release_notes/release_1.03.md
* Add the French catalog release_1.04.po with the corresponding
  translations and drop the moved entries from release_1.03.po
@ThomasMalletCodra

Copy link
Copy Markdown
Contributor

"Apply" button and "auto-recompute on edit" generate new signal or image object.

Need to discuss about :

Warning : if history record is enable, it creates as many history action at each auto-recompute/Apply trigger

image

@PierreRaybaut

Copy link
Copy Markdown
Contributor Author

The investigation confirmed that the reported regression was not introduced by this PR. It came from the pre-existing behavior of the Processing tab: outside history edit mode, Apply created a new object instead of updating the existing result. Auto-recompute followed the same path, making the issue more apparent.

The fixes are grouped in the fix/recompute_duplicate branch:

  • Duplicate objects on Apply and auto-recompute: both paths now recompute the existing result in place, preserving its instance, UUID, group, ROI, annotations, analysis results, and display settings. Starting a new processing operation from the menu still creates a new object. Recorded history parameters and downstream results are updated only in history edit mode.

  • Missing unsaved-changes notification: replacing the data in place did not mark the document as modified, unlike adding a new object. Successful recomputation now emits the object-modified signal, and signal/image panels are connected to the document’s modified-state handler.

  • Incomplete scientific state updates: the previous in-place path copied only the title and data arrays. For example, changing binning factors updated the image dimensions but left the old pixel spacing. A shared helper, used by direct recomputation and history replay, now copies the scientific state: data, coordinates, axis labels, units, and signal uncertainties. Image coordinates are transferred through the appropriate uniform/non-uniform coordinate APIs, while user-owned metadata and display settings remain unchanged.

  • Stale signal ROI masks: after resampling changed the number of points, a cached ROI mask could retain its previous size. Subsequent filtering could then modify values outside the ROI, or masked-data access could fail. The mask cache is now invalidated for signals as well as images after replacing the scientific data. A regression test checks that subsequent filtering leaves values outside the ROI unchanged.

  • Malformed outputs overwriting valid data: the existing data check validated numerical types but not array dimensions. A malformed image output could therefore replace a valid image and still report success. Output structure and image-coordinate consistency are now checked before mutating the destination. Rejected outputs leave the original data, processing parameters, and document modified state unchanged.

  • Accumulation of obsolete Qt editors: rebuilding the Processing tab removed the old tab without destroying its widgets. Repeated Apply or auto-recompute operations therefore retained an additional editor each time. The old scroll area and its editor are now scheduled for deletion. Tests check the number of surviving editors, not just visible tabs.

  • Plot state inconsistent with selection: if the selection changed during computation, the old result could be shown and activated again even though the object tree and properties displayed the newly selected object. Existing plot data is now updated without changing visibility or activation, followed by a refresh of the current selection. The deferred Processing-tab refresh also checks that the result is still current, and Apply cancels any pending auto-recompute timer.

Regression tests cover these cases, including selecting the recomputed result again to verify that its previously hidden plot is up to date. The full DataLab test suite passes: 625 passed, 3 skipped.

@ThomasMalletCodra
ThomasMalletCodra merged commit 391a9b6 into develop Sep 29, 2026
6 checks passed
@PierreRaybaut
PierreRaybaut deleted the feat/live-processing-preview branch October 6, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants