def get_swap_array(orient):
    """Gives how to reorder and flip the axes to fit scanner space

    [phase, readout, slice] -> [x,y,z]
    
    Used with np.moveaxes

    Args:
        orient -- procpar parameter 'orient'
    Returns:
        arr -- sequence of new axes
        flipaxis -- axis to flip
        sliceaxis -- axis of slice encoding
    """
    if orient == 'trans':
        arr = [0,1,2]
        flipaxis = None
        sliceaxis = 2
    elif orient == 'trans90':
        arr = [1,0,2]
        flipaxis = [1]
        sliceaxis = 2
    elif orient == 'sag':
        arr = [1,2,0]
        flipaxis = None
        sliceaxis = 0
    elif orient == 'sag90': 
        arr = [2,1,0]
        flipaxis = [2]
        sliceaxis = 0
    elif orient == 'cor':
        arr = [0,2,1]
        flipaxis = [1]
        sliceaxis = 1
    elif orient == 'cor90': 
        arr = [1,2,0]
        arr = [2,0,1]
        flipaxis = [1,2]
        sliceaxis = 1
    else:
        raise(Exception('Other orientations not implemented'))

    return arr, flipaxis, sliceaxis