-
Notifications
You must be signed in to change notification settings - Fork 1.5k
backward compatible EnsureType #4637
Copy link
Copy link
Closed
Description
Is your feature request related to a problem? Please describe.
the current EnsureType removes any metadata
MONAI/monai/transforms/utility/array.py
Line 464 in 99b9dd7
| output_type = torch.Tensor if self.data_type == "tensor" else np.ndarray |
given it's extensively used in the existing tutorials, would be great to enable metatensor output support and remove the inverse to preserve metadata when inverting the transform.
MONAI/monai/transforms/utility/dictionary.py
Lines 570 to 574 in 99b9dd7
| # FIXME: currently, only convert tensor data to numpy array or scalar number, | |
| # need to also invert numpy array but it's not easy to determine the previous data type | |
| d[key] = convert_to_numpy(d[key]) | |
| # Remove the applied transform | |
| self.pop_transform(d, key) |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels