-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Description
Using SpacingD as a pre-processing transform in a MONAILabel app, and the Deepedit click transforms often require multiple iterations. The default inverse transform runs into 2 errors when trying to inverse the SpacingD transform for the second time:
- 'TypeError: Cannot interpret 'torch.float64' as a data type' from 'get_numpy_dtype_from_string' in 'monai/utils/type_conversion.py' . I am able to fix this locally by changing the function to remove any numpy/torch prefix: 'dtype=str(dtype).split('.')[-1]'
- ' KeyError: 'src_affine' ' from 'monai/transforms/spatial/array.py", line 226, in inverse: kw_args["dst_affine"] = kw_args.pop("src_affine")' . I am able to fix this locally by adding this line before the inverse fn return: 'kw_args["src_affine"] = kw_args["dst_affine"]' in order to restore the src_affine.