def flip_plane(array,plane=0):
# Flip axial plane LR, i.e. change left/right hemispheres. 3D tensors-only, batch_size=1.
# n_slices = array.shape[2]
# for i in range(n_slices):
# array[:,:,i] = np.flipud(array[:,:,i])
# return array
n_x = array.shape[plane]
for i in range(n_x):
if plane == 0:
array[i,:,:] = np.flipud(array[i,:,:])
if plane == 1:
array[:,i,:] = np.flipud(array[:,i,:])
if plane == 2:
array[:,:,i] = np.flipud(array[:,:,i])
return array
评论列表
文章目录