Fundamental MRI Simulations: GitHub
Purpose: This provides simple open source simulations written for understanding basic principles of MRI with visual demonstrations.
Methods and Materials: It is split into three folders. “Basic MR” focuses on simple T1 and T2 MR sequences. “k-space” goes through an example of how k-space and the spatial domain relate using an analogy of music and an example of reconstructing an image of a healthy brain. “MRAcquisition” goes through how frequency and phase encoding work visually and in Fourier space. The code is provided, rather than just images, so that the basic mathematics and physics written out in the functions provided can be seen, modified, and hopefully understood!
Results: An example of the code run shows how phase encoding leads to rotation of a planar wave, and its corresponding location in k-space
Conclusions: The simulations include code available for personal and educational use to demonstrate basics of MRI like T1, T2, Inversion Recovery, Gradient Echo, Spin Echo, Frequency and Phase encoding, and 2D Fourier space.
Demo of the phase-encoding gradient showing the effect of the phase on the orientation of the 2D waves, i.e. acquisition of Fourier space

Demo of the phase encoding gradient and frequency encoding gradient over time leading to acquisition in k-space.


Demo of frequency-encoding axis through change in spatial frequency over time due to the frequency-encoding gradient


Demo of different basic MR spin behavior


Demo of different sequence acquisitions


