Repository navigation
Move analysis results exactly with flipped and rotated pixels - #426
Merged
PierreRaybaut merged 3 commits intoOct 24, 2026
Merged
Conversation
…xels After a flip, a quarter turn or a transposition, the analysis results of the image (centroids, peaks, contours...) were moved about the center of the result image (xc, yc), with a rotation of +/-pi/2 for quarter turns: this was one pixel off (former xc/yc), wrong by up to the image size for quarter turns of non-square or offset images (44 pixels on a 40x64 image), and wrong for non-uniform coordinates. GeometricTransformWrapper now passes the source image, and apply_geometry_transform moves the results with Sigima's transformer.transform_like_image, i.e. exactly as the pixels. The expected values of the existing tests are corrected (mirror about the center of the pixel grid; quarter turns as transposition + mirror) and ROIs are now also checked for quarter turns. New tests check that a result stays on the pixel it describes (uniform anisotropic offset non-square and non-uniform images) and equals the result recomputed on the transformed image. Assisted-by: Claude Opus 5.5
The background area selected in the offset correction dialog was truncated to integer coordinates before being passed to the computation, a leftover of when ROI2DParam coordinates were integers. For images whose coordinates are not in pixels (e.g. in millimeters), the area was wrong, and empty when smaller than one unit. The rectangle is now passed unchanged. Assisted-by: Claude Opus 5.5
Describe the new selection of rectangular ROIs and the fixes of ROIs, annotations and analysis results after flips and rotations, of extracted ROI coordinates, of analysis results in ROIs and of the offset correction area. Update the French translations. Assisted-by: Claude Opus 5.5
Contributor
Author
|
The test workflows only run for PRs targeting
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up of the pixel center convention (DataLab-Platform/Sigima#83, DataLab-Platform/SigimaX#21). Stacked on #425.
Analysis results after flips and rotations
After a flip, a quarter turn or a transposition, the analysis results of an image (centroids, peaks, contours...) were moved about the center of the result image with a ±π/2 rotation for quarter turns: one pixel off, wrong by up to the image size for quarter turns of non-square or offset images (44 px on a 40×64 image), and wrong for non-uniform coordinates.
GeometricTransformWrappernow passes the source image andapply_geometry_transformuses Sigima'stransformer.transform_like_image, i.e. results move exactly with the pixels.Offset correction area
The background area chosen in Processing > Level adjustment > Offset correction was truncated to integers (leftover of integer
ROI2DParamitems): wrong for calibrated images and empty when smaller than one unit. It is now passed unchanged.Review of other usages
profiledialog(inclusive indices, shapes drawn center to center),roieditor(SigimaX adapters only),plothandler(image extent comparison for display only): consistent with the convention, unchanged.Docs
Release notes 1.4 (rectangular ROI selection; fixes) with French translations.
Tests
geometry_transform_unit_test.py: corrected oracle (mirror about the center of the pixel grid, quarter turns = transposition + mirror), ROIs now also checked for quarter turns; new tests: results stay on the pixel they describe (uniform anisotropic offset non-square and non-uniform) and equal the results recomputed on the transformed image. 8 of them fail without the fix.offsetcorrection_app_test.py: calibrated image, removed offset = mean of the selected area (fails without the fix).preview_executor_unit_testunder heavy load (passes when rerun).