def set_transform_metric(method, metric):
    """Sets transformation metric for registration method

    Args:
        method (Sitk.ImageRegistrationMethod): registration computation method (sitk)
        metric (str):                          cc, ants, mi or msq

    Returns:
        (Sitk.ImageRegistrationMethod): registration computation method (sitk)
    """
    if metric == "cc":
        method.SetMetricAsCorrelation()
    elif metric == "ants":
        method.SetMetricAsANTSNeighborhoodCorrelation(2)
    elif metric == "mi":
        method.SetMetricAsJointHistogramMutualInformation()
    elif metric == "msq":
        method.SetMetricAsMeanSquares()

    return method