Project-MONAI/monai-deploy-app-sdk

[IMP] Extend NiftiDataLoader Operator to output Image object

jtetrea opened this issue · 3 comments

Is your enhancement request related to a problem? Please describe.

NiftiDataLoader operator currently outputs a np.ndarray. Need to extend this to wrap in an Image object with correct meta/header information to more easily work with existing MAP workflows.

Describe the solution you'd like

NiftiDataLoader with Image object as IN_MEMORY output.

Describe alternatives you've considered

An alternative would be to use the original DICOM images and take advantage of existing operators, but this is just not possible in some cases where Nifti files are the only form of data.

Additional context

An enhancement like this could enable a workflow such as processing a large batch (10,000+) of Nifti images for rapid inference.

@jtetrea I used SimpleITK as an image loader for the nifti image. However if you use LoadImage from monai it outputs some meta data and the image array. I think we can change the loader to LoadImage and pass on the meta information. Will that solve the problem ?

The MONAI Core LoadImage function with its nii reader also output MetaTensor, essentially Torch Tensor with the few piece of metadata returned from nii reader. The Deploy App SDK inference operators' internal and the InMemImageReader had been updated to support MetaTensor in v0.5.
So, we'll consider supporting MetaTensor on the inference operator input type, hence feeding the MetaTensor from nii data loader directly to the inference operator.