Mismatch of image view and its actual dimensions

I noticed a mismatch between the image dimensions and its view in ITKSnap (in other viewers the view is the same as in ITKSnap). The dimension of the image is 512 * 233. On the left side is the image view in ITKSnap, on the right side is its view after I read it in python, converted it into an array (GetArrayFromImage) and displayed it. It can be seen that the dimensions on the left side don’t correspond to 512 * 233 (the width should be > 2 times the height but it is not), on the other hand, on the right side the image seems to have the correct dimensions but it also seems to be distorted (not sure if it is really distorted or not)
Could you please tell me why the image in ITKSnap is displayed in such a way and what parameters are responsible for the discrepancy between the actual dimensions and the dimensions of the view in ITKSnap? Is it possible to read the image through SimpleITK so that it has the correct dimensions and looks like the view in ITKSnap when displayed?

Hello @a10227,

This has to do with the non-isotropic pixel spacing in your data. This is very common in medical imaging and microscopy. ITK-SNAP accounts for this during display. In your display you just retrieved the pixels without taking spacing into account. This is discussed in the Fundamental Concepts page and in this Jupyter notebook. The latter includes a function make_isotropic which you can use to enable correct display of your images in a notebook.

2 Likes

thank you, make_isotropic helped