Skip to content

Record the image ROI convention for operations taking ROI parameters - #100

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

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

Conversation

@PierreRaybaut

Copy link
Copy Markdown
Contributor

Closes #99

Summary

The selection of image pixels by regions of interest (rule sigima.image.roi.pixel_centers, IMAGE_ROI_CONVENTION, #89) was recorded in the execution context only when an input image carried regions of interest. The operations taking their regions of interest as parameters — extract_roi, extract_rois, erase, offset_correction — are usually called on images without attached ROIs (DataLab defines them graphically): their description recorded no context, and a replay of such a call recorded before Sigima 1.4 (which selected other pixels) was accepted, reporting a different result instead of being refused.

  • image_roi_convention(inputs, contract=None): also returns the rule when the contract has an image input and a ROI2DParam parameter (single, list or both), whatever the inputs — a static property of the operation, read from its contract.
  • describe_call and prepare_execution pass the contract: the rule is recorded and, for a replay, checked (unsupported_context when missing or another version).
  • No version change: the rule (version 1) is unchanged, it is recorded in more cases; the contract versions are unchanged. Signal ROI parameters (ROI1DParam) are not concerned.
  • Docs: module docstrings, guidelines, user guide (contracts), release note — with French translations (checked with a gettext build + sphinx_intl update: no change).

Validation

  • New tests: for the 4 operations on an image without ROI (single and list parameters), the description and the preparation record the rule, a replay with the recorded context gives the same result, replays with a context recorded before Sigima 1.4 ({}, {"x_alignment": None}, {"roi_convention": None}) or another rule version are refused; a registry-wide guard checks that exactly these 4 operations are detected; signal extract_roi records nothing.
  • Full suite: 2340 passed; --qualification-report: no problem (the 4 operations qualified, validation and replay passed).
  • DataLab develop against this branch: provenance, replay and capsule tests pass (138).
  • DataLab-Capsule needs no change: it records the context mapping of the description since Record the execution context declared by the computation library DataLab-Capsule#4.

The selection of image pixels by regions of interest (rule
sigima.image.roi.pixel_centers) was recorded in the execution context only
when an input image carried regions of interest. The operations taking their
regions of interest as parameters (extract_roi, extract_rois, erase and
offset_correction), usually called on images without attached ROIs, depend
on it as well: their description recorded no context, and a replay of such a
call recorded before Sigima 1.4, which selected other pixels, was accepted
and reported a different result instead of being refused.

image_roi_convention() now also takes the contract: an operation with an
image input and a ROI2DParam parameter (single or list) depends on the rule
whatever its inputs. describe_call() and prepare_execution() pass the
contract, so that the rule is recorded and checked for these operations. The
rule and the contract versions are unchanged: the rule is recorded in more
cases. Signal ROI parameters are not concerned.

Closes #99

Assisted-by: Claude Opus 5.5
@PierreRaybaut PierreRaybaut added the bug Something isn't working label Oct 26, 2026
@PierreRaybaut
PierreRaybaut merged commit 70ff787 into develop Oct 26, 2026
6 checks passed
@PierreRaybaut
PierreRaybaut deleted the fix/roi-parameters-convention-context branch October 26, 2026 08:25
@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

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants