Note

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.

nilearn.image.reorder_img#

nilearn.image.reorder_img(img, resample=None)[source]#

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.

Parameters:
imgNiimg-like object

See Input and output: neuroimaging data representation. Image to reorder.

resampleNone or string in {‘continuous’, ‘linear’, ‘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.