Imaginary-time path integral for a relativistic spin-(1/2) particle in a magnetic field