Modeling charge collection in x-ray imagers