Web-App Overview: MRI Simulator

This application simulates the core principles of a Magnetic Resonance Imaging (MRI) machine. It visually represents how hydrogen atoms (protons) inside the body behave under different magnetic conditions, leading to the generation of a detectable signal.

How to Use: Start by clicking "Apply Main Field (B0)" to align the protons. Then, click "Apply RF Pulse" to tip their spins. Next, "Apply Gradient" to spatially encode the signal, and finally, "Detect Signal" to see the resulting signal. You can reset the simulation at any time. The audio toggle controls sound effects. Use the "Play Demo" button to see an automated sequence of steps.

Interactivity: The simulation is designed to be interactive with mouse clicks (or touch taps on mobile) on the buttons. Keyboard interaction is minimal for this version but can be extended for more detailed controls.

Future Directions: Future enhancements could include more complex gradient field simulations (e.g., frequency and phase encoding), a more realistic representation of signal decay (T1 and T2 relaxation), basic image reconstruction visualization, and more detailed educational overlays explaining each step in depth. Further touch gestures for direct canvas manipulation could also be added.