A rad-hard CMOS active pixel sensor for electron microscopy