Software Simulation of Magnetic Resonance Imaging