Since the modifications to the PersistentDataset made in version 1.5.1, the persistent dataset does not allow to save and load metadata. This mean we cannot invert back the initial transforms or even know the original filename (and probably a lot more).
To Reproduce
Steps to reproduce the behavior:
- Install MONAI version 1.5.1
- Load and transform an image through the PersistentDataset
- Re-load the image from cache
- Try to invert and save the image
Expected behavior
The original image and outputted image should be the same
Code used
data = ["./image.nrrd"]
transforms = Compose([LoadImage(ensure_channel_first=True), Rotate90()])
ds=PersistentDataset(data, transform=transforms, cache_dir="./cache")
reloaded_data = ds[0]
reloaded_data = ds[0]
inverter = Invert(transforms)
inverted = inverter(reloaded_data)
saver = SaveImage("./out", output_ext=".nrrd")
saver(inverted)
Let me know if there is a way to bypass this behavior, thank you.
Since the modifications to the PersistentDataset made in version 1.5.1, the persistent dataset does not allow to save and load metadata. This mean we cannot invert back the initial transforms or even know the original filename (and probably a lot more).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The original image and outputted image should be the same
Code used
Let me know if there is a way to bypass this behavior, thank you.