diff --git a/tests/test_scale_intensity.py b/tests/test_scale_intensity.py index b81351ed2e..bd1adac4f4 100644 --- a/tests/test_scale_intensity.py +++ b/tests/test_scale_intensity.py @@ -58,7 +58,7 @@ def test_int(self): def test_channel_wise(self): for p in TEST_NDARRAYS: scaler = ScaleIntensity(minv=1.0, maxv=2.0, channel_wise=True) - data = p(self.imt) + data = p(np.tile(self.imt, (3, 1, 1, 1))) result = scaler(data) mina = self.imt.min() maxa = self.imt.max() diff --git a/tests/test_scale_intensity_range_percentiles.py b/tests/test_scale_intensity_range_percentiles.py index 6ccfaf7ba6..f8656dd929 100644 --- a/tests/test_scale_intensity_range_percentiles.py +++ b/tests/test_scale_intensity_range_percentiles.py @@ -66,7 +66,7 @@ def test_invalid_instantiation(self): self.assertRaises(ValueError, ScaleIntensityRangePercentiles, lower=30, upper=900, b_min=0, b_max=255) def test_channel_wise(self): - img = self.imt[0] + img = np.tile(self.imt, (3, 1, 1, 1)) lower = 10 upper = 99 b_min = 0 @@ -78,8 +78,8 @@ def test_channel_wise(self): for c in img: a_min = np.percentile(c, lower) a_max = np.percentile(c, upper) - expected.append(((c - a_min) / (a_max - a_min)) * (b_max - b_min) + b_min) - expected = np.stack(expected).astype(np.uint8) + expected.append((((c - a_min) / (a_max - a_min)) * (b_max - b_min) + b_min).astype(np.uint8)) + expected = np.stack(expected) for p in TEST_NDARRAYS: result = scaler(p(img)) diff --git a/tests/test_scale_intensity_range_percentilesd.py b/tests/test_scale_intensity_range_percentilesd.py index cd0a5f8c35..5441832a77 100644 --- a/tests/test_scale_intensity_range_percentilesd.py +++ b/tests/test_scale_intensity_range_percentilesd.py @@ -75,7 +75,7 @@ def test_invalid_instantiation(self): s(self.imt) def test_channel_wise(self): - img = self.imt + img = np.tile(self.imt, (3, 1, 1, 1)) lower = 10 upper = 99 b_min = 0