def zscore_normalize(image, mask):
    """
    https://github.com/jcreinhold/intensity-normalization/blob/master/intensity_normalization/normalize/zscore.py

    Normalize a target image by subtracting the mean of the vertebra
    and dividing by the standard deviation

    Args:
        image: target volume
        mask: mask for image
    Returns:
        normalized: image with mean at norm_value
    """
    logical_mask = mask == 1  # force the mask to be logical type
    mean = image[logical_mask].mean()
    std = image[logical_mask].std()
    normalized = (image - mean) / std
    return normalized