Axis order might have been inconsistent
Closed this issue · 3 comments
There appears to be a discrepancy in how the resolution axes are handled. The naming convention and the effect on the resolution axes seem to differ in various parts of the code.
-
The code snippet here reads and parses the ZYX resolution from a TIFF file into
VoxelSize
. This part of the code appears to work correctly. However, the naming convention used is__XY
, which might be misleading because the effect seems to be__YX
.
Lines 141 to 144 in 53d12bd
-
The function here correctly reads and parses the resolution, and ZYX is passed into
VoxelSize
.
Lines 32 to 41 in 53d12bd
-
The code snippet here outputs ZXY resolution from
VoxelSize
, which aligns with the intended behavior but does not match the actual effect observed.
plant-seg/plantseg/io/utils.py
Lines 76 to 95 in 53d12bd
I didn't mark this as a bug because I'm not 100% sure.
I just realised the ImageLayout
always uses XY
. But just confirmed that TIFF and HDF5 both have __YX
/__HW
and both pytorch3dunet
and PlantSeg might have been using __YX
effectively.
The XY
or YX
is a harmless convention (unless you do measurements or have an XY
anisotropy). Most tools agree on XY
, but plantseg and pyotrch3dunet don't. But I would be in favor of moving to YX
everywhere.