Skip to content

Image loading and requirement for transpose() #1086

Answered by fepegar
nicoloesch asked this question in Q&A
Discussion options

You must be logged in to vote

My first question (less important as it has an easy workaround) would by, why torchio.io.ensure4d is not called if a tensor is specified whilst instantiating the Image (and child classes of it) but it is called when I specify the path instead?

I think the idea is that ensure4d tries its best to make to load images and convert the shape into the appropriate one, whereas when you pass a tensor directly as an arg, you have full control of what's being passed and it's your responsibility to use the appropriate shape. Does that make sense?

Regarding the array dims order, see "The order of index and dimensions need careful attention during conversion" in https://simpleitk.org/SimpleITK-Notebo…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@nicoloesch
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by nicoloesch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants