Skip to content
Merged
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
8 changes: 8 additions & 0 deletions tests/functionals/prediction/test_size_finder.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os

import numpy as np
import pytest
import torch

Expand Down Expand Up @@ -90,6 +91,9 @@
(100, 100, 100),
((192, 192, 192), (0, 0, 0)),
),
((16, 8, 8), (10, 10, 10), (4, 4, 4), ((7, 8, 8), (4, 0, 0))),
((16, 10, 10), (10, 10, 10), (4, 4, 4), ((2, 2, 2), (4, 4, 4))),
((12, 12, 8), (10, 10, 10), (4, 4, 4), ((3, 3, 8), (4, 4, 0))),
],
)
def test_find_patch_and_halo_shapes(
Expand All @@ -99,6 +103,10 @@ def test_find_patch_and_halo_shapes(
full_volume_shape, max_patch_shape, min_halo_shape
)
assert result == expected

double_halo_out = np.array(result[1]) * 2
assert np.prod(result[0] + double_halo_out) <= np.prod(max_patch_shape)

double_halo_shape = (
min_halo_shape[0] * 2,
min_halo_shape[1] * 2,
Expand Down
Loading