def get_handedness_from_label(handedness):
    """
    Method to get the passed handedness in XNAT format

    :param handedness: handedness selected
    :return: value accepted by xnat: 'right', 'left', or 'ambidextrous'
    """
    if handedness.lower() in ['right', 'r']:
        return 'right'
    elif handedness.lower() in ['left', 'l']:
        return 'left'
    elif handedness.lower() in ['ambidextrous', 'a']:
        return 'ambidextrous'
    else:
        return 'unknown'
