def cortical_contrast(mean_gm, mean_wm):
    """Calculate the vertex-wise cortical contrast.

    - cortical contrast = (mean WM intensity) - (mean GM intensity) /
                            ( (mean WM intensity + mean GM intensity) / 2 )

    :type mean_gm: float
    :param mean_gm: The mean value of the gray matter voxels.
    :type mean_wm: float
    :param mean_wm: The mean value of the white matter voxels.
    :rtype: float
    :return: The cortical contrast value.
    """

    cort_con = (mean_wm - mean_gm) / ((mean_wm + mean_gm) / 2)

    return cort_con