def flip_axes(data, perms, flips):
""" Flip a data array along specified axes
Parameters
----------
data : 3D array
perms : (3,) sequence of ints
Axis permutations to perform
flips : (3,) sequence of bools
Sequence of indicators for whether to flip along each axis
Returns
-------
3D array
"""
data = np.transpose(data, perms)
for axis in np.nonzero(flips)[0]:
data = nb.orientations.flip_axis(data, axis)
return data
评论列表
文章目录