The geometry of lattice images of steps and dislocations