def METHOD_NAME(reglist, width, height, origin=1):
    # fast_filter_outer_regions filters regions that are outside a rectangle
    # ('image's rectangle') of width 'width' and height 'height' that is has the
    # bottom-left corner at (origin,origin). This function is based on checking
    # for the intersection of the image's rectangle with the bounding box of the
    # regions and therefore it is approximate (some regions that in reality are
    # not within the image's rectangle will not be filtered out if their
    # bounding box still intersects the image rectangle even though the shape
    # itself does not intersect the image's rectangle.
    for k in range(len(reglist)-1,-1,-1):
        reg = reglist[k]
        regname = reg.name.lower()
        if regname[:3] == 'cir' or regname == 'annulus':
            blc, trc = _get_bb_circle(reg)
        elif regname[-3:] == 'box':
            blc, trc = _get_bb_box(reg)
        elif regname == 'ellipse':
            blc, trc = _get_bb_ellipse(reg)
        elif regname == 'polygon':
            blc, trc = _get_bb_polygon(reg)
        elif regname == 'point':
            x = reg.coord_list[0]
            y = reg.coord_list[1]
            if not _is_point_inside(width, height, x, y, origin=origin):
                del reglist[k]
                continue
        elif regname[:4] == 'rect':
            blc, trc = _get_bb_rect(reg)
        elif regname == 'panda':
            blc, trc = _get_bb_circle(reg, True)
        elif regname == 'epanda':
            blc, trc = _get_bb_ellipse(reg, True)
        elif regname == 'bpanda':
            blc, trc = _get_bb_box(reg, True)
        else:
            continue
        if not _is_rect_inside(width, height, blc, trc, origin=origin):
            del reglist[k]
            continue