Skip to content

Commit

Permalink
Update cuCIM min dependency to support randomized transforms (#4004)
Browse files Browse the repository at this point in the history
Signed-off-by: Behrooz <3968947+drbeh@users.noreply.github.com>
  • Loading branch information
drbeh authored Mar 26, 2022
1 parent 6d9918a commit a676e38
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Sphinx==3.5.3
recommonmark==0.6.0
sphinx-autodoc-typehints==1.11.1
sphinx-rtd-theme==0.5.2
cucim==22.2.0; platform_system == "Linux"
cucim==22.2.1; platform_system == "Linux"
openslide-python==1.1.2
imagecodecs; platform_system == "Linux"
tifffile; platform_system == "Linux"
Expand Down
4 changes: 2 additions & 2 deletions tests/test_rand_cucim_dict_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class TestRandCuCIMDict(unittest.TestCase):
]
)
def test_tramsforms_numpy_single(self, params, input, expected):
input = {"image": input}
input = {"image": np.copy(input)}
# apply_prob=1.0
output = RandCuCIMd(keys="image", apply_prob=1.0, **params)(input)["image"]
self.assertTrue(output.dtype == expected.dtype)
Expand All @@ -115,7 +115,7 @@ def test_tramsforms_numpy_single(self, params, input, expected):
]
)
def test_tramsforms_numpy_batch(self, params, input, expected):
input = {"image": input[cp.newaxis, ...]}
input = {"image": np.copy(input[cp.newaxis, ...])}
expected = expected[cp.newaxis, ...]
# apply_prob=1.0
output = RandCuCIMd(keys="image", apply_prob=1.0, **params)(input)["image"]
Expand Down
3 changes: 2 additions & 1 deletion tests/test_rand_cucim_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class TestRandCuCIM(unittest.TestCase):
)
def test_tramsforms_numpy_single(self, params, input, expected):
# apply_prob=1.0
input = np.copy(input)
output = RandCuCIM(apply_prob=1.0, **params)(input)
self.assertTrue(output.dtype == expected.dtype)
self.assertTrue(isinstance(output, np.ndarray))
Expand All @@ -114,7 +115,7 @@ def test_tramsforms_numpy_single(self, params, input, expected):
]
)
def test_tramsforms_numpy_batch(self, params, input, expected):
input = input[cp.newaxis, ...]
input = np.copy(input[cp.newaxis, ...])
expected = expected[cp.newaxis, ...]
# apply_prob=1.0
output = RandCuCIM(apply_prob=1.0, **params)(input)
Expand Down

0 comments on commit a676e38

Please sign in to comment.