def map_patches_to_sources(inverse_mapping, centred_img_patches):
    """
    Given the inverse mapping from image to source space, calculate the array
    of modal sources.

    Parameters
    ----------
    inverse_mapping : numpy array (floats)
        The {NUM_MODES x p} matrix transform that maps the image patches to
        the desired sources.
    centred_img_patches : numpy array (floats)
        The {p x NUM_PATCHES} array of all centred vectorised image patches.

    Returns
    -------
    numpy array (floats)
        The {NUM_MODES x NUM_PATCHES} array of sources.

    """
    return inverse_mapping @ centred_img_patches