| 67 | self.assertEqual(inv_im.applied_operations, []) |
| 68 | |
| 69 | def crop_test_value(self, input_param, input_arr, expected_array): |
| 70 | cropper = self.Cropper(**input_param) |
| 71 | is_map = isinstance(cropper, MapTransform) |
| 72 | for im_type in TEST_NDARRAYS_ALL: |
| 73 | with self.subTest(im_type=im_type): |
| 74 | im = im_type(input_arr) |
| 75 | input_data = {"img": im} if is_map else im |
| 76 | result = self.Cropper(**input_param)(input_data) |
| 77 | out_im = result["img"] if is_map else result |
| 78 | self.assertIsInstance(out_im, MetaTensor) |
| 79 | assert_allclose(out_im, expected_array, type_test=False) |
| 80 | |
| 81 | def multi_inverse(self, input_shape, init_params): |
| 82 | input_data = np.arange(np.prod(input_shape)).reshape(*input_shape) + 1 |