def _clean_label(label, lr, dat_type):
    """Clean the ROI label.

    Parameters
    ----------
    label : str
        ROI label.
    lr : {'L', 'R'}
        Whether current ROI is left/right.
    dat_type : {'anat', 'elec'}
        Whether ROI label comes from anat or elec data.
    """

    # For elec, drop the L/R from the end
    if dat_type is 'elec':
        label = label[:-2]

    # For anat, drop the leading 'left', 'right'
    if dat_type is 'anat':
        if lr is 'L':
            label = label[5:]
        elif lr is 'R':
            label = label[6:]

        # For anat data, drop underscores in the name
        label = label.replace("_", "")

    return label