Unexpected behavior of itk.image_from_array
when passing array.T
#4329
Labels
type:Bug
Inconsistencies or issues which will cause an incorrect result under some or all circumstances
Milestone
Hi, and thanks again for making ITK!
Description
The shape of an image created with
itk.image_from_array
is unexpected when the input is not a contiguous array. I discovered this when passingarray.T
and was surprised when the shape was the same as forarray
. The issue doesn't happen withitk. image_view_from_array
.Steps to Reproduce
Expected behavior
I expected reversed shapes for
itk.image_from_array(array)
anditk.image_from_array(array.T)
.Actual behavior (output of script above)
Reproducibility
Always.
Versions
Environment
$ python <(curl -s https://raw.githubusercontent.com/fepegar/torchio/main/print_system.py) Platform: macOS-14.0-arm64-arm-64bit [...] Python: 3.11.5 (main, Sep 11 2023, 08:31:25) [Clang 14.0.6 ]
The text was updated successfully, but these errors were encountered: