A Pennsylvania federal judge ruled Friday that Varian Medical Systems Inc. has infringed a University of Pittsburgh patent for a device used in radiation cancer treatments, setting the stage for a trial this month on whether the infringement was willful.