You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
get_volume_positions: with allow_missing_positions the tolerances are applied in slices, not mm #464
In get_volume_positions, the allow_missing_positions=True branch measures how far each slice sits from its nearest integer multiple of the spacing in units of the spacing:
atol is documented in mm, and in the regularly-spaced branch it is applied in mm (np.isclose(spacings, spacing, rtol=rtol, atol=atol)). In the missing-positions branch the same atol therefore accepts a larger physical deviation the wider the spacing: a slice 0.5 mm out of place is rejected with atol=0.1 at 1 mm spacing (deviation 0.5 slices) but accepted at 20 mm spacing (deviation 0.025 slices). rtol has the same problem in the other direction: np.allclose makes it relative to the rounded multiple, so it scales with the slice index rather than with the spacing as it does in the regular branch, and the logged "maximum spacing deviation" is printed in slices while the message reads as mm.
A small fix (compute the deviation in mm against round(multiple) * spacing + min, compare with atol + rtol * |spacing|, log in mm) with a test over several spacings is in #465, in case that is easier to judge than the description; happy to close it if you read this differently.
Activity