Generalised calculation of NMR imaging edge effects arising from restricted diffusion in porous media.