def mniposition_to(mnipoint, affine):

    """
    project the position in MNI coordinate system to the position of a point in matrix coordinate system

    Parameters
    ----------
    point : list or array
        The position in MNI coordinate system.
    affine : array or list
        The position information of the fMRI-image array data in a reference space.

    Returns
    -------
    newpoint : array
        The position in matrix coordinate system.
    """

    mx = int(float((mnipoint[0] - affine[0, 3])/affine[0, 0]))
    my = int(float((mnipoint[1] - affine[1, 3])/affine[1, 1]))
    mz = int(float((mnipoint[2] - affine[2, 3])/affine[2, 2]))

    return mx, my, mz