Non axis aligned orientation in real world data?

Hello from your experience is it happening that direction cosine matrix is not axis aligned for studies like CT PET MRI . I mean when orientation is not RAS or LPS … can not be summarized in 3 letter code because it is oblique .
I had looked into ITK code for changing orientation [1] and it seems to if I am not mistaken that it is working generally on permutation of axes and reversing axes only, what would confirm my hypothesis, but I am not sure.


OrientImageFilter is for changing anatomical orientations.

For non-orthogonal slices, management and resampling with the SliceSeriesSpecialCoordinatesImage may be helpful.

1 Like

Have you tried setting SetForceOrthogonalDirection(false)?


Thanks, Hovewer I suppose I did not phrased m question clearly i mainly thnking should i check for the cases where i have non axis aligned image that gets from a scanner; did you had such issues in some of your datasets?

You always have the option to resample the image to orthogonal grid, and possibly isotropic spacing. If you don’t plan to do a lot of processing on them, maybe it is fine leaving them non-orthogonal? Slicer can correctly display such images.

1 Like

ok thanks !

An image is in RAS coordinate system if the index to physical transform transforms image IJK coordinates to the RAS coordinate system. It does not matter if the direction matrix is just a permutation matrix or some arbitrary rotation matrix.

What you are probably wondering about is that if you work with images that are usually rotated (such as prostate MRI images) and you want to train a deep learning model with them, if you need to resample the voxel array so that the image is perfectly oriented in physical space. Based on the somewhat limited experience that I have in this, I would say that it is important to have all your images to have consistent order and direction of axes and approximately the same image spacing, but it may be fine to ignore an image orientation error of up to a few ten degrees (as the patient positioning may have some variation in orientation and deep learning models can also develop a tolerance for this). However, if you resample for a consistent image spacing anyway then you might consider taking into account the exact image orientation, too.