Atomic-scale structure and formation of self-assembled In(Ga)As quantum rings