nilearn

Swap axes of a 3D image in nilearn/numpy

为君一笑 提交于 2020-05-28 04:27:08
问题 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:

Swap axes of a 3D image in nilearn/numpy

情到浓时终转凉″ 提交于 2020-05-28 04:26:26
问题 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:

Swap axes of a 3D image in nilearn/numpy

寵の児 提交于 2020-05-28 04:26:11
问题 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: