marcomusy / vedo

A python module for scientific analysis of 3D data based on VTK and Numpy
https://vedo.embl.es
MIT License
2.04k stars 265 forks source link

Axes order of numpy array #1184

Open snownontrace opened 2 months ago

snownontrace commented 2 months ago

Hi Marco,

I noticed that vedo.Volume uses the xyz order instead of conventionally used zyx. For example, when loading an image with vedo.load(image), the array order is xyz, but the io.imread(image) from skimage and tifffile etc. returns zyx. I am swapping x and z for now, but it might be the best to use zyx order by default.

Thanks! Shaohe

marcomusy commented 2 months ago

Hi! You are right and this is quite annoying.. vedo always assumes real world coordinates and I'm afraid it is too late to change convention on this one.. But I understand it can be a source of confusion. I can add some documentation and maybe a keyword option , something like Volume(..., assume_zyx=True) is maybe helpful?

snownontrace commented 2 months ago

Yes, that would be very helpful! If more vedo users process scientific image data, it might be worth making assume_zyx=True by default.