https://github.com/benoitberanger/mri_rf_pulse_simulation_matlab
MRI RF pulse simulation in MALTAB
https://github.com/benoitberanger/mri_rf_pulse_simulation_matlab
application gui matlab mri pulse rf simulation
Last synced: 25 days ago
JSON representation
MRI RF pulse simulation in MALTAB
- Host: GitHub
- URL: https://github.com/benoitberanger/mri_rf_pulse_simulation_matlab
- Owner: benoitberanger
- License: gpl-3.0
- Created: 2023-05-03T10:36:06.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-06-12T15:15:35.000Z (27 days ago)
- Last Synced: 2025-06-14T09:05:21.801Z (25 days ago)
- Topics: application, gui, matlab, mri, pulse, rf, simulation
- Language: MATLAB
- Homepage:
- Size: 2.07 MB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MRI $RF$ pulse simulation in MALTAB
This repository is a MATLAB application that simulate the response of MRI **R**adio**F**requency (**RF**) pulses.
The app is a GUI, and the code also made to be used purely programmatically.1. Open the GUI app
2. Click on a pulse in the library list.
3. The selected $RF$ pulse is loaded with default parameters, plotted in the GUI, and it's simulation triggered. The simulation is plotted automatically : magnetization vector across time $M_{xzy}(t)$, slice profile $\Delta Z$, chemical shift profile $\Delta B_0$.The application is highly object oriented, to take advantage of heritage and composition of several abstract classes.
Also, you can use your own pulses in the app by:
- A super fast method: fill the $RF$ pulse shape ($B1$ curve $GZ$ curve) in the the `USER_DEFINED` pulse, then trigger the GUI so simulate the profile.
- An ergonomic method made for interactivity: add your own $RF$ pulse class in `+mri_rf_pulse_sim/+rf_pulse/+local/` so it will appear in the GUI library. _This directory is not versioned in this repo_## Features
### GUI
The GUI have 3 independent panels:
- **Pulse definition**: It shows the library of pulses, and the selected pulse, including its shape and the UI parameters.

- **Simulation parameters**: You define the range and granularity (number of points) for the slice profile evaluation $\Delta Z$ and the chemical shift $\Delta B_0$ evaluation.

- **Simulation results**: Displays $M_{xzy}(t)$, the slice profile $\Delta Z$, and the chemical shift $\Delta B_0$ profile.
### Scripting
Here is some examples of non-GUI analysis:
- [Why SINC is used for slice selection instead of to RECT ?](+mri_rf_pulse_sim/+analysis/rect_vs_sinc.m)
- [Too much B1max ? RF clip ? maybe increase pulse duration](+mri_rf_pulse_sim/+analysis/rf_clip.m)
- [FOCI is derived from HS pulse. But is it better ?](+mri_rf_pulse_sim/+analysis/compare_hs_foci.m)
- [Why do we need a slice selection gradient **rewinder** ?](+mri_rf_pulse_sim/+analysis/slice_selection_rewinder_lob.m)### Object oriented programming
All pulses are objects.
Pulses can inherit from others: `FOCI` is derived from `HyperbolicSecant`.
Pulses can be composed of several abstract classes.
For example, `slr_mb_verse` is a **SLR** base waveform, then the **M**ulti**B**and algorithm is applied to excite several slices, and finally the **VERSE** algorithm reduces it's duration and $B1_{max}$ using constrains.### Re-usability
One of the objectives here is to centralize the equations/algorithms of $RF$ pulse so they can be almost copy-pasted in other programming environments, like a complete sequence simulator, or a sequence development environment from your manufacturer.
One difficulty when looking in the literature is that different sources can have different vocabulary or different parameters. A typical example is the **H**yperbolic**S**ecant, which is the extremely well described, but with a large variety of implementation using different input parameters.### Use vendor specific pulses
#### Bruker
- Copy your pulses into `/vendor/bruker/`.
- In the GUI, select "BRUKER", this will fetch all files and display them in a list.
- Click on a pulse to load it and simulate it.
The parser is [load_bruker_RFpulse.m](+mri_rf_pulse_sim/load_bruker_RFpulse.m)#### Siemens
- Copy your `.dat` file from into `/vendor/siemens/`.
- In the GUI, select "SIEMENS", this will fetch all files and display them in a list.
- Click on a pulse to load it and simulate it.
The parser is [load_siemens_RFpulse.m](+mri_rf_pulse_sim/load_siemens_RFpulse.m)## Examples
### HS : Hyperbolic Secant
### FOCI : Frequency Offset Corrected Inversion
## Download and install
1. Clone the repository with
- `git clone --recurse-submodules https://github.com/benoitberanger/mri_rf_pulse_simulation_matlab.git`
2. In Matlab, `cd /path/to/mri_rf_pulse_simulation_matlab`
3. Start the app with `mri_rf_pulse_sim.app()`## Limitations
- MATLAB R2023a+ ? maybe few release earlier, but I did not test them.## External dependency
**None**, except for :
- For SLR pulses :
- DSP System Toolbox
- Signal Processing Toolbox## Tested on
MATLAB R2023a+## Alternatives
In all alternatives that I found, in Python, MATLAB, Julia, all of them have very nice features, but none has the same interactivity and ergonomy.- Python : https://github.com/mikgroup/sigpy
- Matlab : https://github.com/leoliuf/MRiLab
- Julia : https://github.com/cncastillo/KomaMRI.jl