neurolabusc / MRIcroGL10_OLD

DEPRECATED development has moved to https://github.com/rordenlab/MRIcroGL
https://www.nitrc.org/plugins/mwiki/index.php/mricrogl:MainPage
BSD 2-Clause "Simplified" License
58 stars 24 forks source link

Don't set ortho slice to (0,0,0) when no transform #7

Closed nanoant closed 8 years ago

nanoant commented 8 years ago

When file does not specify origin or/and voxel size then transform matrix is identity. However when loading such file we try to set initial slice position to (0,0,0) regardless there is no coordinate system given. In such case we land in the top left corner, which is a bit confusing. This change checks if transform is identify and then keeps initial slice position at the center of image space.

This makes MRIcroGL also in par with MacOS MRIcro.

neurolabusc commented 8 years ago

Thanks. Hopefully all images will have a valid spatial transform in the header SForm or Form, but without this it makes sense to assume the origin is the center of the volume.