We present a theoretical analysis of spin relaxation, for a polarized gas of spin 1/2 particles undergoing restricted adiabatic diffusive motion within a container of arbitrary shape, due to magnetic field inhomogeneities of arbitrary form.