preprocessing.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:segmentation_DLMI 作者: imatge-upc 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号