def get_filter(self, header=None, origin=<NUM_LIT:1>):
from .region_to_filter import as_region_filter<EOL>if header is None:<EOL><INDENT>if not self.check_imagecoord():<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>reg_in_imagecoord = self<EOL><DEDENT>else:<EOL><INDENT>reg_in_imagecoord = self.as_imagecoord(header)<EOL><DEDENT>region_filter = as_region_filter(reg_in_imagecoord, origin=origin)<EOL>return region_filter<EOL>
Get filter.
        Often, the regions files implicitly assume the lower-left
        corner of the image as a coordinate (1,1). However, the python
        convetion is that the array index starts from 0. By default
        (``origin=1``), coordinates of the returned mpl artists have
        coordinate shifted by (1, 1). If you do not want this shift,
        use ``origin=0``.

        Parameters
        ----------
        header : `astropy.io.fits.Header`
            FITS header
        origin : {0, 1}
            Pixel coordinate origin

        Returns
        -------
        filter : TODO
            Filter object