Parameter Dependency in Modular MR Sequences using Directed Graphs

Cristoffer Cordes^{1}, Thorsten Honroth^{1}, Daniel Hoinkiss^{1}, Saulius Archipovas^{1}, David Porter^{1}, and Matthias Günther^{1,2}

As MRI sequences become more complex, the complexity of the dependencies between its components increases likewise. It is desirable to encapsulate parts of the sequence structure to enable reuse, but on the other hand sequence modules are configured in multiple interwoven, partially ordered steps. Established approaches enforce a linear order on the calculation steps. That does not capture this behavior adequately and thereby produces sequence descriptions that are hard to understand, maintain and extend. Those sequence definitions also require additional developer input to efficiently check derived parameters for consistency—such as during binary search of protocol configuration.

This work presents a novel sequence description and sequence traversal strategy which yields a new perspective on MRI sequences, eases encapsulation and development, and is guaranteed to perform calculations at highest efficiency.

**Sequence preparation (see [fig1])**

A sequence consist of modules that are arranged hierarchically. Each module is defined isolatedly and describes its parameters, which can be used for calculations by other modules, and parameter dependencies, which are resolved in the sequence preparation stage to yield an acyclic directed graph of all parameters and dependencies. Opposed to conventional approaches, the calculation order is not set explicitly.

**Sequence traversal (see [fig2])**

After the sequence is prepared, it can be traversed as dictated by the sequence structure, i.e. to run the sequence or calculate channel waveforms. However, the traversal does not evoke any calculations directly. Setting parameter nodes of the graph recursively iterates all dependent nodes and invalidates their values.

When a basic sequence module is reached in the traversal process, its defining parameters are calculated through the graph. Each invalid dependency input is tagged recursively to find the minimal calculation graph required for that parameter. Afterwards, those calculations are performed, starting at seed points identified by the tagging process. Once calculated, nodes stay valid unless invalidated by setting a parameter that it depends upon. This allows a reuse of calculated parameters by other sequence modules. Also, parameters that are not needed to parameterize the object are not calculated, neither are parameters that merely depend upon those parameters.

The twice-refocused, spin-echo diffusion MRI scheme [1] is a typical example of a sequence with complex parameter dependencies due to the interactions between the EPI readout and the diffusion preparation. It is defined through multiple parameter conditions that imply a certain calculation and calculation order. The parameter set has to fulfill a number of conditions simultaneously, such as the nulling of eddy currents, the level of diffusion weighting and the scan geometry. An imperative programming paradigm requires the explicit calculation order, and a minor change in the conditions, such as spoiling instead of eddy current nulling, usually has side-effects that are hard to grasp from the sequence code.

The algorithm of this work derives
the calculation order automatically and reveals potential side effects that can
be expected when exchanging parts of the dependencies. **(see [fig3])**

[1] Reese et.al., DOI:10.1002/mrm.10308

**[fig1] Sequence description and prepared sequence**

The sequence description contains parameter dependencies and hierarchy information. The preparation establishes the hierarchy to allow for sequence traversal and configures the parameter graph to enable parameter getting and setting during sequence traversal.

**[fig2] Running a prepared sequence**

Starting at the root element containing the protocol parameters, each subordinate element is traversed recursively, repeating at loops. Setting values, i.e., loop counters does not evoke any calculation. Getting values, i.e. gradient pulse shapes evokes calculations along the shortest possible path, keeping parameters valid afterwards.

**[fig3] Sequence preparation example**

The twice-refocused, spin-echo diffusion preparation is described easiest using implicit conditions on the parameters. When formulated as dependencies, they can be given in any order in the sequence description. The prepared sequence offers a different view on the sequence that can be helpful during development.

**[fig4] Efficient calculation of critical parameters by explointing graph structure**

To test a sequence protocol for consistency, many calculation orders may be reasobale. The subgraphs required for critical parameters can be prioritized automatically to identify infeasible protocol parameters and postpone non-critical calculation steps.

**[fig5] Acquired images parameterized by the graph approach**

ADC map (a) and color FA map (b) with isotropic 2mm resolution, TE=86.5ms, TR=5525ms, b-value=1000s/mm², echo spacing=660us, λ0=100ms (eddy current decay constant). Acquired using a dedicated pulse sequence on a Siemens MAGNETOM Skyra system.

Proc. Intl. Soc. Mag. Reson. Med. 24 (2016)

3198