(self)
| 34 | assert_allclose(identity_func(img), lambd(img), type_test=False) |
| 35 | |
| 36 | def test_lambda_slicing(self): |
| 37 | for p in TEST_NDARRAYS: |
| 38 | img = p(self.imt) |
| 39 | |
| 40 | def slice_func(x): |
| 41 | return x[:, :, :6, ::2] |
| 42 | |
| 43 | lambd = Lambda(func=slice_func) |
| 44 | out = lambd(img) |
| 45 | assert_allclose(slice_func(img), out, type_test=False) |
| 46 | self.assertIsInstance(out, MetaTensor) |
| 47 | self.assertEqual(len(out.applied_operations), 1) |
| 48 | out = lambd.inverse(out) |
| 49 | self.assertEqual(len(out.applied_operations), 0) |
| 50 | |
| 51 | def test_lambda_track_meta_false(self): |
| 52 | for p in TEST_NDARRAYS: |
nothing calls this directly
no test coverage detected