Skip to content

Commit 1110539

Browse files
committed
Round Backprojected Values for Discrete Calculation
- Float imprecision meant mulit-part segmentations weren't converting properly. - Now it rounds floats to 2 decimal places to address this float imprecision while avoiding inaccurate categorization.
1 parent baceea7 commit 1110539

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

python/ouroboros/helpers/files.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ def volume_from_intermediates(path: Path, shape: DataShape, discrete: bool = Fal
218218
nz = np.flatnonzero(vol[0])
219219
vol[0, nz] /= vol[1, nz]
220220
if discrete:
221+
vol[0] = np.round(vol[0], 2)
221222
vol[0, vol[0] % 1 != 0] = 0
222223
return vol[0]
223224

0 commit comments

Comments
 (0)