Swap axes of a 3D image in nilearn/numpy
问题 I am working with some neuroimaging data and my dimensions for a scan is (100, 150, 100). I am currently working with the nibabel formatted file. Is there a nice way to swap the axes? For example, I want my image to be (100, 100, 150). I would preferable want this in the nibabel format, but if need be, I can get the image to a numpy ndarray and then do the work there as well. In this case, is there a nice way of doing this in numpy? Thank you for the help! 回答1: If you are using numpy use: