def _get_lut_id(lut, label, use_lut):
    """Convert a label to a LUT ID number."""
    if not use_lut:
        return 1
    assert isinstance(label, str)
    mask = lut['name'] == label
    assert mask.sum() == 1
    return lut['id'][mask]
