def _get_image_root_type(image_type):
    """Determines which root an image type is located in.

    Args:
        image_type (str): Type of image.

    Returns:
        str: Either "input" or "output" for the corresponding root.
    """
    inputs = {
        "background_color",
        "background_color_levels",
        "background_disp",
        "background_disp_levels",
        "background_disp_upsample",
        "color",
        "color_levels",
        "foreground_masks",
        "foreground_masks_levels",
    }
    outputs = {
        "bin",
        "confidence",
        "cost",
        "disparity",
        "disparity_upsample",
        "disparity_levels",
        "disparity_time_filtered",
        "disparity_time_filtered_levels",
        "fused",
        "mismatches",
        "exports",
        "exports_cubecolor",
        "exports_cubedisp",
        "exports_eqrcolor",
        "exports_eqrdisp",
        "exports_lr180",
        "exports_tb3dof",
        "exports_tbstereo",
    }
    root_map = dict.fromkeys(inputs, "input")
    root_map.update(dict.fromkeys(outputs, "output"))
    return root_map[image_type]