From abbb743e7ea4701ba5a436aefe0ae038cbc43192 Mon Sep 17 00:00:00 2001 From: Mohammad Adil Date: Wed, 4 Mar 2020 20:03:12 -0800 Subject: [PATCH] Fix resize not using order. --- monai/transforms/transforms.py | 2 +- tests/test_resize.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/monai/transforms/transforms.py b/monai/transforms/transforms.py index 50db0d612f..408b291a58 100644 --- a/monai/transforms/transforms.py +++ b/monai/transforms/transforms.py @@ -115,7 +115,7 @@ def __init__(self, output_shape, order=1, mode='reflect', cval=0, self.anti_aliasing_sigma = anti_aliasing_sigma def __call__(self, img): - return resize(img, self.output_shape, + return resize(img, self.output_shape, order=self.order, mode=self.mode, cval=self.cval, clip=self.clip, preserve_range=self.preserve_range, anti_aliasing=self.anti_aliasing, diff --git a/tests/test_resize.py b/tests/test_resize.py index 51f54e8c86..7feaf9f634 100644 --- a/tests/test_resize.py +++ b/tests/test_resize.py @@ -30,8 +30,9 @@ def test_invalid_inputs(self, _, order, raises): resize(self.imt) @parameterized.expand([ - ((64, 64, 3), 1, 'reflect', 0, True, True, True, None), - ((32, 32, 3), 2, 'constant', 1, False, False, False, None) + ((1, 1, 64, 64), 1, 'reflect', 0, True, True, True, None), + ((1, 1, 32, 32), 2, 'constant', 3, False, False, False, None), + ((1, 1, 256, 256), 3, 'constant', 3, False, False, False, None), ]) def test_correct_results(self, output_shape, order, mode, cval, clip, preserve_range,