MONAI icon indicating copy to clipboard operation
MONAI copied to clipboard

LoadImage and SaveImage using network source (S3 or Google Cloud Storage)

Open karwojan opened this issue 3 years ago • 3 comments

It would be very useful to load/save images directly from/to network storage (like S3 or Google Cloud Storage) using pure monai transforms. I have a pretty simple idea how to implement such a feature adding single extra argument to LoadImage and SaveImage transforms.

We could treat input and output paths as pointing to the network sources instead of local files, because classic storage services like S3 use filesystem-like chierarcical structure of object keys. LoadImage transform could accept a Callable, which download object from network storage and save to temporary files, which is then used by readers and any other regular LoadImage transform logic. Similarly SaveImage writer could optionally save data to temporary file, which is then uploaded to network storage.

I've prepared PR presenting this idea. It works as it is already used in my own project.

karwojan avatar Apr 14 '22 11:04 karwojan

Is it still open? @karwojan

hpoddar2810 avatar Oct 18 '22 11:10 hpoddar2810

#4136 is the PR.

dzenanz avatar Oct 24 '22 15:10 dzenanz

It would be nice to support NGC dataset as well: https://docs.ngc.nvidia.com/cli/cmd_dataset.html https://docs.ngc.nvidia.com/api/

mingxin-zheng avatar Jun 09 '23 03:06 mingxin-zheng

Having Amazon HealthLake support would be great too. And it is already supported in ITK: https://gist.github.com/thewtex/434c482a4998a3a61ce4f91fa7c5b44c

aylward avatar Oct 20 '23 15:10 aylward

maybe out of scope for monai core.

vikashg avatar Jan 05 '24 14:01 vikashg