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

Method test_padding_mode

tests/transforms/test_zoom.py:110–116  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

108 zoom_fn(p(self.imt[0]))
109
110 def test_padding_mode(self):
111 for p in TEST_NDARRAYS_ALL:
112 zoom_fn = Zoom(zoom=0.5, mode="nearest", padding_mode="constant", keep_size=True)
113 test_data = p([[[1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]]])
114 zoomed = zoom_fn(test_data)
115 expected = p([[[0.0, 0.0, 0.0, 0.0], [0.0, 1.0, 1.0, 0.0], [0.0, 1.0, 1.0, 0.0], [0.0, 0.0, 0.0, 0.0]]])
116 assert_allclose(zoomed, expected, type_test=False)
117
118
119if __name__ == "__main__":

Callers

nothing calls this directly

Calls 2

ZoomClass · 0.90
assert_allcloseFunction · 0.90

Tested by

no test coverage detected