Modeling of bremsstrahlung emission from the confined runaway electrons and applications to the hard x-ray monitor of ITER. (5th October 2018)