def METHOD_NAME(df: gpd.GeoDataFrame, window: 'Box',
                    background_class_id: int, all_touched: bool) -> np.ndarray:
    """Rasterize geometries that intersect with the window.
    Args:
        df (gpd.GeoDataFrame): All label geometries in the scene.
        window (Box): The part of the scene to rasterize.
        background_class_id (int): Class ID to use for pixels that don't
            fall under any label geometry.
        all_touched (bool): If True, all pixels touched by geometries will be
            burned in. If false, only pixels whose center is within the
            polygon or that are selected by Bresenham's line algorithm will be
            burned in. (See :func:`.rasterize` for more details).
            Defaults to False.
    Returns:
        np.ndarray: A raster.
    """
    if len(df) == 0:
        return np.full(window.size, background_class_id, dtype=np.uint8)
    window_geom = window.to_shapely()
    # subset to shapes that intersect window
    df_int = df[df.intersects(window_geom)]
    # transform to window frame of reference
    shapes = df_int.translate(xoff=-window.xmin, yoff=-window.ymin)
    # class IDs of each shape
    class_ids = df_int['class_id']
    if len(shapes) > 0:
        raster = rasterize(
            shapes=list(zip(shapes, class_ids)),
            out_shape=window.size,
            fill=background_class_id,
            dtype=np.uint8,
            all_touched=all_touched)
    else:
        raster = np.full(window.size, background_class_id, dtype=np.uint8)
    return raster