mr-sequence-diagrams icon indicating copy to clipboard operation
mr-sequence-diagrams copied to clipboard

Draw MR Sequence Diagrams for LaTeX / MetaPost

#+TITLE: Pulse Sequence Graphics

#+begin_quote The files "pulses.mp" and "seq.mp" found in this repository were originally created by Mark J White for his PhD Thesis and were hosted at his website /celos.net/, which unfortunately does not exist anymore. A snapshot is available in the Internet Archive [[http://web.archive.org/web/20160629144038/http://www.celos.net/comp/pulses/][here]], though. According to his website: You're free to use, modify or copy the files in any way you like, as long as you credit Mark with copyright and authorship for the bits he wrote, and understand that it comes without any kind of guarantee. As a further note: Two of the macros found in /pulses.mp/, namely =tablegrf= and =xtablegr= were written by T. A. Wilkinson and can be found in his blog [[https://tinkertailorsoldiersponge.com/blog/2013/12/17/pulse-sequence-diagrams-using-metapost][here]]. #+end_quote

This repository contains a MetaPost file called /pulses.mp/ which contains a set of macros for easily generating MR Pulse Sequence Diagrams programatically. It also contains a file called /seq.mp/ with examples of how to use the macros.

To generate example images from those files simply run: #+BEGIN_SRC sh mpost seq.mp #+END_SRC

For this to work, MetaPost has to be installed in the system, which should be the case if you have a proper LaTeX distribution. Should ImageMagick also be installed, it is possible to convert images to PNG by calling ~convert -density 300 input.mps output.png~. Alternatively, to include .mps files directly into a LaTeX file you can use the graphicx package and add a =\includegraphics{input.mps}= wherever the figure should be included.

  • Examples

** FID Acquisition #+ATTR_ORG: :width 400 [[./images/figs-0.png]] ** Spin Echo Fragment #+ATTR_ORG: :width 400 [[./images/figs-1.png]] ** Gradient Echo Fragment #+ATTR_ORG: :width 400 [[./images/figs-2.png]] ** Slice Selection Fragment #+ATTR_ORG: :width 400 [[./images/figs-3.png]] ** Readout Encoding Fragment #+ATTR_ORG: :width 400 [[./images/figs-4.png]] ** Phase Encoding Fragment with Spin Echo #+ATTR_ORG: :width 400 [[./images/figs-5.png]] ** Multislice SE volume acquisition #+ATTR_ORG: :width 400 [[./images/figs-6.png]] ** 3D GRE with EPI Factor 3 #+ATTR_ORG: :width 400 [[./images/figs-7.png]] ** Echo Symbol [[./images/figs-100.png]]