This work introduces a web technology-based tool that can load device vendor-independent sequence descriptions of a previously described format to then provide interactive tools for configuring protocol parameters, viewing pulse sequence diagrams and details, and exporting raw pulse shapes.
It is generally not possible to recreate detailed pulse shape descriptions from measurement protocol parameters alone. On the other hand, raw pulse sequence descriptions obscure how protocol parameters and hardware limitations influenced the contained pulse shapes. Therefore, a fully reproducible MRI pulse sequence needs to contain the calculation logic used to derive the hardware events.
A concept for efficient calculation and evaluation of vendor-independent, portable pulse sequences, that can be configured and run in a way indistinguishable from vendor-provided pulse sequences, was presented previously [1,2,3]. The vendor-independent core logic, was designed to be easily integrable, even into very restrictive programming environments, while still allowing for flexible, configurable sequences. This work presents a tool for reproducing and exploring MRI sequence parameters and pulse shapes, which can be run in any modern web browser using the same core codebase as the scanner drivers.
The portable MRI sequences are comprised of two decoupled data structures: One structure for looping and pulse module hierarchy, and an acyclic directed graph structure for all pulse sequence parameter calculations. To run such a sequence, the hierarchy is traversed, repeating at loops while setting loop counter parameters. When a pulse module corresponding to a hardware event is visited, its defining parameters are retrieved through the parameter graph structure[1].
The core codebase for traversing hierarchy, working with the parameter graph and extracting hardware events are written in the Lua [4] scripting language, which can be easily integrated into C/C++-Code.
The main codebase, which is also used for sequence configuration and calculation directly on the MRI hardware, was compiled to WebAssembly [5], which can be run on any device with a modern web browser, including mobile devices.The core was embedded into a web application that provides an interactive front-end for configuring, viewing, exploring and exporting sequences.
For configuration, the front-end provides an interface for specifying protocol parameters, which is structured the same way as an interface that is available to the scanner operator while configuring the actual measurement to provide a consistent experience.
The sequence can be viewed as a pulse sequence diagram, consisting of channels for gradient, radio frequency and ADC pulses/events. Further info, such as measurement headers of ADC events and logical connections of pulse sequence segments to the sequence hierarchy can be investigated interactively in the diagram.
The sequence can also be explored in the form of its underlying pulse sequence hierarchy, where the influence of protocol parameters and loop counters on the sequence module parameters can be evaluated. It is furthermore possible to change calculation instructions and scripts, e.g. for RF pulse shapes and line ordering logic.
The configured sequence can be exported to the Pulseq format [6]. This step is not reversible, since information about module hierarchy, calculation logic, measurement headers and protocol parameters are not part of the exported format.
A tool demo can be found at [7]. There is no client-server communication besides serving/retrieving of static web content. Consequently, the tool can be downloaded to be run without an internet connection. All calculations are performed within the client's web browser.
A selection of example sequences that are capable of acquiring images of vendor sequence implementation quality [8] can be viewed generally within less than their run-time. This performance is comparable to running the lua codebase natively, implying that the WebAssembly layer intoduces no significant computational overhead.
The compressed core logic has a size of 500KB, and a compressed, fully self-contained MRI sequence including all calculation logic has a size of around 50KB.
1. Cordes C, Honroth T, Hoinkiss D, Archipovas S, Porter DA, Günther M. Parameter Dependency in Modular MR Sequences using Directed Graphs. Proc Intl Soc Mag Reson Med 2016;3198.
2. Honroth T, Cordes C, Archipovas S, Hoinkiss DC, Günther M, Porter D. Platform-Independent, Rapid Prototyping of MR Sequences Without Code Compilation. Proc Intl Soc Mag Reson Med 2016;3207.
3. Archipovas S, Honroth T, Cordes C, Günther M, Porter DA. MRI Pulse Sequence Development Using Graphical User Interface Modules. Proc. Intl. Soc. Mag. Reson. Med. 2017:1510.
4. Ierusalimschy R, de Figueiredo LH, Filho WC. Lua---An Extensible Extension Language. Software: Practice and Experience 2000;26:635-652.
5. Haas A, Rossberg A, Schuff DL, Titzer BL, Holman M, Gohman D, Wagner L, Zakai A, Bastien JF. Bringing the Web Up to Speed with WebAssembly. Proc of the ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI); 2017;
6. Layton KJ, Kroboth S, Jia F, Littin S, Yu H, Leupold J, Nielsen J, Stöcker T, Zaitsev M. Pulseq: A Rapid and Hardware‐Independent Pulse Sequence Prototyping Framework. Magn Reson Med 2017;77:1544-1552.
7. http://gamma-star.mevis.fraunhofer.de
8. Cordes C, Konstandin S, Porter D, Günther M. Vendor-Independent MRI Sequences using Flow-Graph Calculations. Magn Reson Med (under review).