-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve the confusion about dimension order and orientation through their respective keyword arguments in LoadImage
#7365
Comments
Indeed, networks don't care about the order, but users do, and, judging by the list of issues/discussions above, they get confused at times (including me). That definitely has to do with all sorts of conventions out there, and that issue cannot be solved, but I believe that it can be transparent, more easily changed, and consistent across readers. A
For ease of use, I believe all MONAI readers should be consistent with regard to the order and the orientation of the images they load. |
Alright, so there's something we realized just now. We used to get it into the PyTorch convention by doing:
And we used to have issues with
I think that, therefore, having |
Is your feature request related to a problem? Please describe.
WHD
, PyTorch:DHW
).PyTorch 3D Conv docs:
![image](https://private-user-images.githubusercontent.com/18015788/294226783-82381b16-ad9b-4e27-a661-df233f0383b3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MTg4OTIsIm5iZiI6MTczOTYxODU5MiwicGF0aCI6Ii8xODAxNTc4OC8yOTQyMjY3ODMtODIzODFiMTYtYWQ5Yi00ZTI3LWE2NjEtZGYyMzNmMDM4M2IzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDExMjMxMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA3MDk3OTdhZDUwMWFkNjQwODJjYTNlMDVmNjdlNzQ0MDRmZmY1OTgxYjVkOGEyNDQxMmFjZjA0NTI0OTlmZjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.1alukgIbRbALx9qNrDPO6tzMqFkrxeN-Ce__xtS5ts4)
reverse_indexing
option in LoadImage is misleading - I tried it withNrrdReader
,NibabelReader
, andITKReader
, and it only worked withITKReader
. At least in theory for my case (not to clutter the post, I will upload the picture in the response).Here are a few issues/discussions describing the confusion/differences/conventions:
Describe the solution you'd like
Similarly to how
LoadImage
hasensure_channel_first
, it would be really transparent, flexible, and a non-breaking change to have:order
/dim_order
, set by default toWHD
as per MONAI convention, but a user could change it toDWH
or any other combination.orientation
, can be set toRAS
,LPS
, etc. I am not sure right now if there is a consistent convention for different formats or if it varies. It could be implemented in a "non-breaking" way, similar to howLoadImage
'sreader
is implemented, but it might be useful to have it consistent for all formats.reverse_indexing
is probably unnecessary.Additional context
Personally, even though I have been using MONAI for quite a while now, I always transpose the images so that: 1) they follow the PyTorch convention, 2) we see the axial slice (first dim after batch and channel dims) in the same way that a radiologist would look at it. I also orient the images LPS, but that's irrelevant rn.
The proposed approach may be particularly important for sharing models/MONAI Bundle - the dimension order or orientation used can be different between models and easily overlooked, rendering the weights almost useless if the data is not in the correct format. The proposed feature would make it more transparent as well as more easily documented by developers/sharers.
The text was updated successfully, but these errors were encountered: