When dose delivery to the patient is evaluated by extracting the primary photon fluence impinging on a portal imaging device, scattered radiation from the patient acts as noise. Our aim in the present study is to establish and test a procedure to filter out scatter radiations from portal images by experimental determination of a scatter filtering function. We performed a dose calibration of the Varian (Varian Medical Systems, Palo Alto, CA) aS500 electronic portal imaging device in routine use in our institution. We then analyzed the collected data and extracted the scatter filtering function by applying a simple scatter model with the aid of home-made software. To check the reliability of our calculations we compared central axis dose values in a PMMA phantom computed using the extracted primary fluence with those obtained from experimental TMR(0) tabulated values obtaining a agreement within about 3%. We finally performed a check of dose delivery repeatability by calculating the dose delivered to the EPID during portal image acquisition for patient positioning. Delivered dose per MU fluctuations were within 5% over a set of images acquired during routine use with no prior application of any procedure aimed at optimizing dosimetric repeatability.