{"id":15145331,"url":"https://github.com/benoitberanger/mri_rf_pulse_simulation_matlab","last_synced_at":"2026-03-14T10:39:02.864Z","repository":{"id":161080961,"uuid":"635730222","full_name":"benoitberanger/mri_rf_pulse_simulation_matlab","owner":"benoitberanger","description":"MRI RF pulse simulation in MATLAB","archived":false,"fork":false,"pushed_at":"2025-08-29T13:19:24.000Z","size":2221,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-29T16:33:28.464Z","etag":null,"topics":["application","gui","matlab","mri","pulse","rf","simulation"],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benoitberanger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-03T10:36:06.000Z","updated_at":"2025-08-29T13:19:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"fe7c1c7b-1457-4197-9bd8-d78445e51211","html_url":"https://github.com/benoitberanger/mri_rf_pulse_simulation_matlab","commit_stats":{"total_commits":294,"total_committers":1,"mean_commits":294.0,"dds":0.0,"last_synced_commit":"5d34017d3841aaf3e287ab5497d0b7129f262a0a"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/benoitberanger/mri_rf_pulse_simulation_matlab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitberanger%2Fmri_rf_pulse_simulation_matlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitberanger%2Fmri_rf_pulse_simulation_matlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitberanger%2Fmri_rf_pulse_simulation_matlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitberanger%2Fmri_rf_pulse_simulation_matlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benoitberanger","download_url":"https://codeload.github.com/benoitberanger/mri_rf_pulse_simulation_matlab/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitberanger%2Fmri_rf_pulse_simulation_matlab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275806087,"owners_count":25531916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-18T02:00:09.552Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["application","gui","matlab","mri","pulse","rf","simulation"],"created_at":"2024-09-26T11:23:23.258Z","updated_at":"2025-09-18T17:48:21.260Z","avatar_url":"https://github.com/benoitberanger.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MRI $RF$ pulse simulation in MATLAB\n\nThis repository is a MATLAB application that simulate the response of MRI **R**adio**F**requency (**RF**) pulses.\nThe app is a GUI, and the code also made to be used purely programmatically.\n\n1. Open the GUI app\n2. Click on a pulse in the library list.\n3. 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$.\n\nThe application is highly object oriented, to take advantage of heritage and composition of several abstract classes.\n\nAlso, you can use your own pulses in the app by:\n- 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.\n- 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_\n\n\n## Features\n\n### GUI\nThe GUI have 3 independent panels:\n- **Pulse definition**: It shows the library of pulses, and the selected pulse, including its shape and the UI parameters.\n![Pulse definition](docs/gui_pulse_definition.png)\n- **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.\n![Simulation parameters](docs/gui_simulation_parameters.png)\n- **Simulation results**: Displays $M_{xzy}(t)$, the slice profile $\\Delta Z$, and the chemical shift $\\Delta B_0$ profile.\n![Simulation results](docs/gui_simulation_results.png)\n\n### Scripting\nHere is some examples of non-GUI analysis:  \n- [Why SINC is used for slice selection instead of to RECT ?](+mri_rf_pulse_sim/+analysis/rect_vs_sinc.m)\n- [Too much B1max ? RF clip ? maybe increase pulse duration](+mri_rf_pulse_sim/+analysis/rf_clip.m)\n- [FOCI is derived from HS pulse. But is it better ?](+mri_rf_pulse_sim/+analysis/compare_hs_foci.m)\n- [Why do we need a slice selection gradient **rewinder** ?](+mri_rf_pulse_sim/+analysis/slice_selection_rewinder_lob.m)\n\n### Object oriented programming\nAll pulses are objects.  \nPulses can inherit from others: `FOCI` is derived from `HyperbolicSecant`.  \nPulses can be composed of several abstract classes.\nFor 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.\n\n\n### Re-usability\nOne 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.  \nOne 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.\n\n\n### Use vendor specific pulses\n\n#### Bruker\n- Copy your pulses into `\u003cpackage_dir\u003e/vendor/bruker/`.  \n- In the GUI, select \"BRUKER\", this will fetch all files and display them in a list.  \n- Click on a pulse to load it and simulate it.  \nThe parser is [load_bruker_RFpulse.m](+mri_rf_pulse_sim/load_bruker_RFpulse.m)\n\n#### Siemens\n- Copy your `.dat` file from into `\u003cpackage_dir\u003e/vendor/siemens/`.  \n- In the GUI, select \"SIEMENS\", this will fetch all files and display them in a list.  \n- Click on a pulse to load it and simulate it.  \nThe parser is [load_siemens_RFpulse.m](+mri_rf_pulse_sim/load_siemens_RFpulse.m)\n\n## Examples\n\n### HS : Hyperbolic Secant\n![HS](docs/gui_HS.png)\n\n### FOCI : Frequency Offset Corrected Inversion\n![FOCI](docs/gui_FOCI.png)\n\n\n## Download and install\n1. Clone the repository with \n    - `git clone --recurse-submodules https://github.com/benoitberanger/mri_rf_pulse_simulation_matlab.git`\n2. In Matlab, `cd /path/to/mri_rf_pulse_simulation_matlab`\n3. Start the app with `mri_rf_pulse_sim.app()`\n\n\n## Limitations\n- MATLAB R2023a+ ? maybe few release earlier, but I did not test them.\n\n\n## External dependency\n\n**None**, except for : \n- For SLR pulses : \n    - DSP System Toolbox\n    - Signal Processing Toolbox\n\n\n## Tested on\nMATLAB R2023a+\n\n\n## Alternatives\nIn all alternatives that I found, in Python, MATLAB, Julia, all of them have very nice features, but none has the same interactivity and ergonomy.\n\n- Python : https://github.com/mikgroup/sigpy\n- Matlab : https://github.com/leoliuf/MRiLab\n- Julia : https://github.com/cncastillo/KomaMRI.jl\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitberanger%2Fmri_rf_pulse_simulation_matlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenoitberanger%2Fmri_rf_pulse_simulation_matlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitberanger%2Fmri_rf_pulse_simulation_matlab/lists"}