def convert_labels(Lorig, params, toLasStandard=True):
    """
    Convert the labels from the original CLS file to consecutive integer values starting at 0
    :param Lorig: numpy array containing original labels
    :param params: input parameters from params.py
    :param toLasStandard: determines if labels are converted from the las standard labels to training labels
        or from training labels to the las standard
    :return: Numpy array containing the converted labels
    """
    L = Lorig.copy()
    if toLasStandard:
        labelMapping = params.LABEL_MAPPING_TRAIN2LAS
    else:
        labelMapping = params.LABEL_MAPPING_LAS2TRAIN

    for key,val in labelMapping.items():
        L[Lorig==key] = val

    return L