Skip to content

Record the image ROI pixel convention in the execution context - #92

Merged
PierreRaybaut merged 1 commit into
developfrom
fix/roi-pixel-convention-context
Oct 25, 2026
Merged

PierreRaybaut merged 1 commit into
developfrom
fix/roi-pixel-convention-context

Conversation

@PierreRaybaut

Copy link
Copy Markdown
Contributor

Closes #89

Summary

Sigima 1.4 selects the pixels of image regions of interest by their centers (#83, #84). This changes the result of almost every image operation when its input carries regions of interest, while calls on images without ROIs are unchanged. Increasing every image contract (~117) would refuse the replay of all image activities recorded with 1.3; keeping them unchanged let such replays report different without telling why.

The convention is now a rule of the execution context, like the X-alignment policy:

  • sigima.image.roi.pixel_centers, version 1 (sigima.proc.contracts.IMAGE_ROI_CONVENTION, read-only mapping);
  • image_roi_convention(inputs): the record when an input image carries (non-empty) regions of interest, None otherwise;
  • describe_call returns a new context mapping ({"roi_convention": {...}} when it applies), and prepare_execution adds it to the prepared context;
  • for a replay, prepare_execution(..., context=...) raises ExecutionError("unsupported_context") when an input image carries regions of interest and the recorded rule is missing (recorded before Sigima 1.4: explicit message) or is another one.

Calls on images without ROIs and on signals are not concerned. DataLab-Capsule records the context mapping of the description since DataLab-Platform/DataLab-Capsule#4 (merged).

Docs: module docstrings, guidelines (rules shared by all operations are versioned in the context, not in the contracts), release note (with French translations).

Tests

  • New test_image_roi_convention_is_recorded_and_checked: nothing recorded nor required without ROI (or with an empty ROI), recorded by the description and the preparation with a ROI (also on an operand), replay with the record gives the same result, replays without it or with another rule/version are refused, signal ROIs not concerned.
  • Full suite: 2313 passed; --qualification-report: no problem.
  • DataLab (develop with DataLab-Capsule develop): provenance, capsule and replay tests pass (150). End-to-end check: an image with a ROI processed (Gaussian filter, centroid) records the rule and replays exactly; the same activity without the rule is refused with the explicit reason; an image without ROI records nothing.

…text

Sigima 1.4 selects the pixels of image regions of interest by their centers,
which changes the result of almost every image operation whose input carries
regions of interest, while calls on images without ROIs are unchanged. A
replay with Sigima 1.4 of such a call recorded with 1.3 reported a different
result without telling why; increasing every image contract would have
refused the replay of all image activities, ROI or not.

The convention is now a rule of the execution context, like the X-alignment
policy: sigima.image.roi.pixel_centers, version 1 (IMAGE_ROI_CONVENTION).
describe_call returns it in a new "context" mapping, and prepare_execution
in the prepared context, whenever an input image carries regions of
interest (image_roi_convention). For a replay, prepare_execution refuses
(unsupported_context) a call on images carrying regions of interest whose
recorded context does not name this rule (recorded before Sigima 1.4) or
names another version. Calls on images without ROIs and on signals are not
concerned.

DataLab-Capsule records the "context" mapping of the description since
DataLab-Platform/DataLab-Capsule#4. The guidelines state that such rules,
not the contract versions, are increased when a convention shared by all
operations changes.

Closes #89

Assisted-by: Claude Opus 5.5
@PierreRaybaut
PierreRaybaut merged commit 5bf40a8 into develop Oct 25, 2026
6 checks passed
@PierreRaybaut
PierreRaybaut deleted the fix/roi-pixel-convention-context branch October 25, 2026 07:51
@ThomasMalletCodra ThomasMalletCodra added this to the v1.4.0 milestone Oct 27, 2026
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