This issue is probably related to the discussion here. I will make a PR based on the solution suggested there.
As far as I can tell, this only happens in cases where the image axes are rotated wrt to the RAS coordinate system. In such cases, it may be better to use SimpleITKIO, but I think the NibabelIOWithReorient should still handle this special case correctly.
During nnunet inference, I noticed that the output orientation of a predicted segmentation is not always identical to the input image orientation.
Here is a demonstration. An example image for which this happens is attached: test_seg.nii.gz
This gives the output:
This issue is probably related to the discussion here. I will make a PR based on the solution suggested there. As far as I can tell, this only happens in cases where the image axes are rotated wrt to the RAS coordinate system. In such cases, it may be better to use SimpleITKIO, but I think the NibabelIOWithReorient should still handle this special case correctly.