An analytical model of SEM and STEM charge collection images of dislocations in thin semiconductor layers: I. Minority carrier generation, diffusion, and collection