Open qin-yu opened 1 month ago
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.
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
. https://github.com/kreshuklab/plant-seg/blob/53d12bd00dbc3f4490577a3fb1ce71207c0adf84/plantseg/io/tiff.py#L141-L144The function here correctly reads and parses the resolution, and ZYX is passed into
VoxelSize
. https://github.com/kreshuklab/plant-seg/blob/53d12bd00dbc3f4490577a3fb1ce71207c0adf84/plantseg/io/tiff.py#L32-L41The code snippet here outputs ZXY resolution from
VoxelSize
, which aligns with the intended behavior but does not match the actual effect observed. https://github.com/kreshuklab/plant-seg/blob/53d12bd00dbc3f4490577a3fb1ce71207c0adf84/plantseg/io/utils.py#L76-L95