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

Method test_shape

tests/transforms/test_squeezedimd.py:84–89  ·  view source on GitHub ↗
(self, input_param, test_data, expected_shape)

Source from the content-addressed store, hash-verified

82class TestSqueezeDim(unittest.TestCase):
83 @parameterized.expand(TESTS)
84 def test_shape(self, input_param, test_data, expected_shape):
85 result = SqueezeDimd(**input_param)(test_data)
86 self.assertTupleEqual(result["img"].shape, expected_shape)
87 self.assertTupleEqual(result["seg"].shape, expected_shape)
88 if "dim" in input_param and isinstance(result["img"], MetaTensor) and input_param["dim"] == 2:
89 assert_allclose(result["img"].affine.shape, [3, 3])
90
91 @parameterized.expand(TESTS_FAIL)
92 def test_invalid_inputs(self, exception, input_param, test_data):

Callers

nothing calls this directly

Calls 2

SqueezeDimdClass · 0.90
assert_allcloseFunction · 0.90

Tested by

no test coverage detected