An inherent anti-scatter detector for megavoltage x-ray imaging