Is your feature request related to a problem? Please describe.
Though this might cause inconsistencies between data and metadata in MetaTensor,
it's still convenient to support updating MetaTensor array content with the numpy API, given that numpy is one of the core dependencies of MONAI. This feature request is mainly trying to address the recent interoperability concerns:
- reading the array into a numpy array as a shortcut of
a.detach().cpu().numpy() (sharing the array memory as much as possible):
a = MetaTensor([2.0])
assert(isinstance(a.array, numpy.ndarray))
- writing the array content
from monai.data import MetaTensor
a = MetaTensor([1.0])
a.array = np.asarray([2.0])
cc @SachidanandAlle