Skip to content

Possibility to revert initial transformations on network outputs #365

@martaranzini

Description

@martaranzini

Is your feature request related to a problem? Please describe.
It would be useful to have a way to apply to the network output "reverse" transformations of those initially used as pre-processing on the inputs. For instance, if the inputs are resized or cropped with the relevant Monai transforms, it would be useful to be able to resize or pad the network output back to the original image size.

Describe the solution you'd like
Perhaps a way to keep track of the original image size and the coordinates of the cropping could be sufficient to "revert" those transforms on the output and restore the original image size?

Additional context
In my case, I have images with slightly different sizes which are all mapped to (96, 96) at training. At inference, I could not use the Resize Transform at generating the Monai dataset, as I would lose the original size information and would not be able to generate segmentation outputs with the correct size. I overcame the issue by applying the resize operation on the tensors within the evaluation loop instead of using the Monai transform.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions