Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .coverage
Binary file not shown.
4 changes: 4 additions & 0 deletions python/ouroboros/pipeline/slices_geom_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def _process(self, input_data: tuple[any]) -> None | str:
if not isinstance(sample_points, np.ndarray):
return "Input data must contain an array of sample points."

# Remove duplicates from sample points.
_, indicies = np.unique(sample_points.round(decimals=2), axis=0, return_index=True)
sample_points = sample_points[sorted(indicies)]

# Rescale the sample points if the option is enabled
if config.annotation_mip_level != config.output_mip_level:
mip_sizes = get_mip_volume_sizes(source_url)
Expand Down
9 changes: 5 additions & 4 deletions python/test/helpers/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,6 @@ def test_np_convert_from_float():
# Direct Conversion
assert np.all(np_convert(np.uint16, float_data, normalize=False) == [0] * 15 + [1])

# Normalized Conversion
assert np.all(np_convert(np.uint16, float_data) ==
np.arange(0, np.iinfo(np.uint16).max + 1, np.iinfo(np.uint16).max // 15))

# Safe Bool
safe_bool = np_convert(bool, base, safe_bool=True)
assert safe_bool.dtype == np.uint8
Expand All @@ -328,6 +324,11 @@ def test_np_convert_from_float():
assert safe_bool.dtype == bool
assert np.all(safe_bool == (base > 0))

# Normalized Conversion; slight inaccuracy introduced for type safety
target = np.arange(0, np.iinfo(np.uint16).max + 1, (np.iinfo(np.uint16).max) // 15)
target[1:] = target[1:] - 1
assert np.all(np_convert(np.uint16, float_data) == target)


def test_volume_from_intermediates():
pass
Expand Down