This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.

7.5.15. nilearn.image.reorder_img

nilearn.image.reorder_img(img, resample=None)

Returns an image with the affine diagonal (by permuting axes). The orientation of the new image will be RAS (Right, Anterior, Superior). If it is impossible to get xyz ordering by permuting the axes, a ‘ValueError’ is raised.


img: Niimg-like object

resample: None or string in {‘continuous’, ‘nearest’}, optional

If resample is None (default), no resampling is performed, the axes are only permuted. Otherwise resampling is performed and ‘resample’ will be passed as the ‘interpolation’ argument into resample_img.