Repository navigation
Sample segment profiles from end point to end point - #102
Merged
Merged
Conversation
Since #98, segment profiles were sampled in steps of the smallest distance between pixel centers, up to floor(length / step) steps: the end point was omitted whenever the length was not a multiple of the step (the diagonal of a 10 x 10 image stopped at pixel (8, 8), duplicating some pixels), a segment shorter than one step only sampled its start point, and a tiny spacing (non-uniform coordinates, strongly anisotropic pixels) gave hundreds of millions of samples for a few pixels. Segment profiles are now sampled like in Sigima 1.3, in physical coordinates: one sample per pixel along the axis where the segment spans the most pixels (from the pixel nearest to its start point to the pixel nearest to its end point), at regular steps from the start point to the end point included, each sample taking the nearest pixel. The number of samples never exceeds the number of rows or columns of the image. On images without calibration, horizontal, vertical and diagonal segments take the same pixels as in Sigima 1.3; other oblique segments take the nearest pixel instead of truncating its indices. The release note no longer states that all results are unchanged on such images. The contract stays at version 2, introduced by #98 and not released yet. Closes #101 Assisted-by: Claude Opus 5.5
This was referenced Oct 26, 2026
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.
Closes #101
Summary
Since #98,
segment_profilesampled the segment in steps of the smallest distance between pixel centers (count = floor(length / step) + 1):(0, 0)–(9, 9)of a 10 × 10 image gave 13 samples up to pixel(8, 8), duplicating some pixels and missing pixel(9, 9); a segment shorter than one step only sampled its start point;[0, 1e-8, 1, 2, 3], ordx = 1e-8) gave hundreds of millions of samples (several GB) for a few pixels.Segment profiles are now sampled like in Sigima 1.3 (
csline), in physical coordinates:max(|Δcolumn|, |Δrow|) + 1samples, from the pixels nearest to the two end points;max(rows, columns)samples, whatever the pixel sizes.The contract stays at version 2 (introduced by #98, not released yet). The release note no longer claims that all results are unchanged on images without calibration: horizontal, vertical and diagonal segments take the same pixels as in Sigima 1.3, other oblique segments take the nearest pixel instead of truncating its indices (French translation updated, checked with a gettext build +
sphinx_intl update).Companion: DataLab-Platform/DataLab#440 (same branch name) updates the description of the segment profile in the DataLab documentation.
Validation
profile_physical_unit_test.py): end points included on diagonal and oblique segments, identical to Sigima 1.3 for axis-aligned and diagonal segments (6 cases, reference reimplemented from 1.3), segments shorter than a pixel / within one pixel / of zero length, tiny spacings (non-uniform and anisotropic: 5 samples for a 5 × 5 image).--qualification-report: no problem (segment_profilev2 qualified, validation and replay passed).