Converts list of regions to FITS region table.

    Parameters
    ----------
    regions : list
        List of `regions.Region` objects

    Returns
    -------
    region_string : `~astropy.table.Table`
        FITS region table

    Examples
    --------

    >>> from regions import CirclePixelRegion, PixCoord
    >>> reg_pixel = CirclePixelRegion(PixCoord(1, 2), 5)
    >>> table = fits_region_objects_to_table([reg_pixel])
    >>> print(table)
    X [1] Y [1] SHAPE    R [4]    ROTANG COMPONENT
    pix   pix            pix      deg
    ----- ----- ------ ---------- ------ ---------
      1.0   2.0 circle 5.0 .. 0.0      0         1

def fits_region_objects_to_table(regions):
    """
    Converts list of regions to FITS region table.

    Parameters
    ----------
    regions : list
        List of `regions.Region` objects

    Returns
    -------
    region_string : `~astropy.table.Table`
        FITS region table

    Examples
    --------

    >>> from regions import CirclePixelRegion, PixCoord
    >>> reg_pixel = CirclePixelRegion(PixCoord(1, 2), 5)
    >>> table = fits_region_objects_to_table([reg_pixel])
    >>> print(table)
    X [1] Y [1] SHAPE    R [4]    ROTANG COMPONENT
    pix   pix            pix      deg
    ----- ----- ------ ---------- ------ ---------
      1.0   2.0 circle 5.0 .. 0.0      0         1

    """
    for reg in regions:
        if isinstance(reg, SkyRegion):
            raise TypeError('Every region must be a pixel region'.format(reg))

    shape_list = to_shape_list(regions, coordinate_system='image')
    return shape_list.to_fits()