Project-MONAI / research-contributions

Implementations of recent research prototypes/demonstrations using MONAI.
https://monai.io/
Apache License 2.0
991 stars 326 forks source link

How to output with the original size? #197

Open yuanc3 opened 1 year ago

yuanc3 commented 1 year ago

The original image will be transformed (Spacingd & CropForegroundd) before being input into the model, so how can it be reshaped to the original size? For example, "img0035.nii.gz" is (512,512,94), after being transformed, it will be (314, 214, 234).

tangy5 commented 1 year ago

There is a post transform called "Invertd", you could simply apply it as a posttransform, and it will read the preoprocessing transform parameters and do the reverse automatically. The other choice is to resample manually after getting the segmentation, do a resize using other packages, or Spacingd, cropp, pad etc..

Invertd: https://docs.monai.io/en/stable/transforms.html#invertd

zjy399 commented 8 months ago

有一个叫做“Invertd”的后变换,你可以简单地将其应用为后变换,它将读取预处理变换参数并自动执行反转。另一种选择是在获得分割后手动重新采样,使用其他包或 Spacingd、cropp、pad 等进行调整大小。

倒置:https://docs.monai.io/en/stable/transforms.html#invertd

Has this issue been resolved? Can you provide the code?