MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / test_longest_shape

Method test_longest_shape

tests/transforms/test_resize.py:114–124  ·  view source on GitHub ↗
(self, input_param, expected_shape)

Source from the content-addressed store, hash-verified

112
113 @parameterized.expand([TEST_CASE_0, TEST_CASE_1, TEST_CASE_2, TEST_CASE_2_1, TEST_CASE_3, TEST_CASE_4])
114 def test_longest_shape(self, input_param, expected_shape):
115 input_data = np.random.randint(0, 2, size=[3, 4, 7, 10])
116 input_param["size_mode"] = "longest"
117 result = Resize(**input_param)(input_data)
118 np.testing.assert_allclose(result.shape[1:], expected_shape)
119
120 set_track_meta(False)
121 result = Resize(**input_param)(input_data)
122 self.assertNotIsInstance(result, MetaTensor)
123 np.testing.assert_allclose(result.shape[1:], expected_shape)
124 set_track_meta(True)
125
126 def test_longest_infinite_decimals(self):
127 resize = Resize(spatial_size=1008, size_mode="longest", mode="bilinear", align_corners=False)

Callers

nothing calls this directly

Calls 2

ResizeClass · 0.90
set_track_metaFunction · 0.90

Tested by

no test coverage detected