In-plane anisotropic magnetoresistance in antiferromagnetic Ba(Fe$_{1-x}$Co$_x$)$_2$As$_2$, (Ba$_{1-x}$K$_x$)Fe$_2$As$_2$ and Ba(Fe$_{1-x}$Ru$_x$)$_2$As$_2$
Using the Kubo-Greenwood formalism the resistivity anisotropy for electron doped Ba(Fe$_{1-x}$Co$_x$)$_2$As$_2$, hole doped (Ba$_{1-x}$K$_x$)Fe$_2$As$_2$ and isovalently doped Ba(Fe$_{1-x}$Ru$_x$)$_2$As$_2$ in their antiferromagnetic state has been calculated in order to clarify the origin of this important phenomenon. The results show good agreement with experiment for all cases without considering impurity states extending over several unit cells or temperature induced spin fluctuations. From this it is concluded that the resistivity anisotropy at low temperatures is primarily caused by an in-plane anisotropic magnetoresistance. Accounting for the band dispersion with respect to $k_z$ is however mandatory to explain the results, showing the importance of the three-dimensional character of the electronic structure for the iron pnictides. Furthermore, it is shown that the counterintuitive sign of the resistivity anisotropy is no fundamental property but just a peculiarity of the anisotropic band structure.