def norm_z_value(img, ref_img):
    """This function will normalize the two images using z-value normalization
    Parameters
    ----------
    img : ndarray
        The image to normalize
    ref_img : ndarray
        The referene image
    Returns
    -------
    img : ndarray
        The image that's been normalized.
    """
    # Get standard deviations for current and prior
    imgstd = img.std()
    refstd = ref_img.std()
    # Align prior standard deviation to current
    img = ((img - img.mean()) / imgstd) * refstd + ref_img.mean()

    return img