def roi_array_to_dict(a):
    """Convert the `ROIs` structured arrays to :py:class:`dict`

    Parameters
    ----------
    a : numpy.ndarray
        Structured array containing ROI data

    Returns
    -------
    list of dict
        One dict per ROI. Keys are "top_left", "bottom_right", and "bin",
        values are tuples whose first element is the x axis value and the
        second element is the y axis value.
    """
    l = []
    a = a[['startx', 'starty', 'endx', 'endy', 'groupx', 'groupy']]
    for sx, sy, ex, ey, gx, gy in a:
        d = {'top_left': [int(sx), int(sy)], 'bottom_right': [int(ex), int(
            ey)], 'bin': [int(gx), int(gy)]}
        l.append(d)
    return l
