Repository navigation
Fix 1.4.0 review issues: non-uniform analysis results, empty ROI extraction, empty radial profile, dependency docs - #110
Merged
Conversation
pyproject.toml requires guidata >= 3.17.0 since 8c51eaa, while requirements.txt and the dependency table of the documentation still listed 3.16.0. Both are regenerated with guidata.utils.genreqs, the French documentation catalogs follow, and the release notes state the new requirement. Assisted-by: Claude Opus 5.5
get_radial_profile failed on empty data with an obscure NumPy error
("zero-size array to reduction operation maximum"), e.g. on the image
extracted from a ROI holding no pixel. It now raises an explicit
ValueError. The contract of radial_profile is unchanged: these inputs were
already refused.
Assisted-by: Claude Opus 5.5
extract_roi and extract_rois silently created an empty image when the regions of interest held no pixel of the image: e.g. the cells of a ROI grid narrower than a pixel (5 cells of 9 on a 4x4 image with the default grid), a rectangle outside the image or with no width, or a circle passing between pixel centers. They now raise an explicit ValueError. Inputs that were accepted are now refused: the contracts of extract_roi and extract_rois are increased to version 2. The mask of extract_rois is computed once. The test that expected an empty image for an empty ROI now expects the refusal. Assisted-by: Claude Opus 5.5
…oordinates
compute_geometry_from_obj converted the pixel indices returned by the
analysis functions with dx, dy, x0 and y0 whatever the coordinates of the
image. These values do not describe images with non-uniform coordinates:
the results (centroid, enclosing circle, peaks, contours, blobs, Hough
circles) were given in pixel indices, or according to a former uniform
calibration left after switch_coords_to("non-uniform").
For non-uniform coordinates, the indices (offset by the first pixel of the
ROI) are now converted with axis_to_physical, and radii and semi-axes are
scaled by the local pixel size at the shape center. The conversion of
images with uniform coordinates is unchanged (bit-identical results).
The results change for non-uniform images: the contracts of centroid,
enclosing_circle, peak_detection, contour_shape, blob_dog, blob_doh,
blob_log, blob_opencv and hough_circle_peaks are increased to version 2.
Assisted-by: Claude Opus 5.5
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.
Fixes from a review of Sigima 1.4.0 before its release (one commit per issue).
Summary
Analysis results of non-uniform images (95cb972)
compute_geometry_from_objconverted the pixel indices returned by the image analyses withdx,dy,x0andy0, whatever the coordinates of the image. These values do not describe images with non-uniform coordinates, so the results ofcentroid,enclosing_circle,peak_detection,contour_shape,blob_dog,blob_doh,blob_log,blob_opencvandhough_circle_peakswere:dx = dy = 1,x0 = y0 = 0). Example: the centroid of a blob at pixel (51, 51) was(51, 51)instead of(58.4, 57.6);switch_coords_to("non-uniform"). Example:35.5instead of72.5.For non-uniform coordinates, the indices (offset by the first pixel of the ROI, in index space) are now converted with
axis_to_physical. Radii and semi-axes are scaled by the local pixel size at the shape center. The conversion of images with uniform coordinates is unchanged (bit-identical). The nine contracts are at version 2.ROIs holding no pixel (fdfcf28)
extract_roiandextract_roissilently created an empty image when the regions of interest held no pixel of the image. For example, 5 of the 9 cells of the default ROI grid on a 4×4 image hold no pixel. A rectangle outside the image or with no width does the same, and so does a circle passing between pixel centers. They now raise an explicitValueError. Inputs that were accepted are now refused, so both contracts are at version 2. The mask ofextract_roisis computed once.generate_image_grid_roiis unchanged: the DataLab grid editor relies on it.Radial profile of an empty image (3481b82)
get_radial_profilefailed on empty data with an obscure NumPy error (zero-size array to reduction operation maximum). It now raises an explicitValueError. The contract is unchanged, since these inputs were already refused.Dependency documentation (582d274)
requirements.txtanddoc/requirements.rststill listedguidata >= 3.16.0after 8c51eaa. They are regenerated withguidata.utils.genreqs, and the French catalogs follow. The release notes now state the guidata 3.17.0 requirement.Release notes
Validation
New
geometry_nonuniform_unit_test.py(16 tests):The non-uniform tests fail on
develop.New tests for the extraction of ROIs holding no pixel (uniform and non-uniform, grid cells) and for the radial profile of empty images.
test_empty_image_roi, which expected an empty image, now expects the refusal.Full suite: 2389 passed.
pytest --qualification-report: no problems; the 11 increased contracts are qualified at version 2 with exact replays.Follow-up
DataLab-Platform/DataLab: branch
fix/release-1.4-review(CI uses this Sigima branch). It regenerates the Desktop families reference file and adds the release notes.The Web families reference file of DataLab still records
centroidandpeak_detectionin version 1: these activities are refused, as expected, until DataLab-Web regenerates it.