Project-MONAI / MONAI

AI Toolkit for Healthcare Imaging
https://monai.io/
Apache License 2.0
5.71k stars 1.04k forks source link

How to save prediction image #5790

Closed mineeuk closed 1 year ago

mineeuk commented 1 year ago

I'm using UNETR code a brain image dataset instead of BTCV, but the prediction image is not saved. Is there any other way?

KumoLiu commented 1 year ago

Hi @ellenyumin, you can use SaveImage to save the predictions. https://github.com/Project-MONAI/MONAI/blob/97918e46e0d2700c050e678d72e3edb35afbd737/monai/transforms/io/array.py#L292

saver = SaveImage(output_dir="./output", output_ext=".nii.gz", output_postfix="seg")
saver(output)

Thanks!