<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_fits_region(filename, regions, header=None):
 """ Converts list of regions to FITS region table and write to a file. Parameters filename: str Filename in which the table is to be written. Default is 'new.fits' regions: list List of `regions.Region` objects header: `~astropy.io.fits.header.Header` object The FITS header. Examples -------- """

    output = fits_region_objects_to_table(regions)

    bin_table = fits.BinTableHDU(data=output, header=header)
    bin_table.writeto(filename)