JEMRIS 2.9.1
open-source MRI simulations
No Matches
First steps tutorial: sequence

In this tutorial the user is guided through the setup and simulation of an EPI experiment. This step by step introduction shall enable the user to setup own experiments thereafter.

To proceed the user must have successfully installed JEMRIS.

Setup the EPI sequence

  • Start up MATLAB
  • Add the directory with the JEMRIS matlab code to the MATLAB path with >> addpath /usr/local/share/jemris/matlab
  • Start up the Sequence GUI with the following command
    >> JEMRIS_seq The Sequence GUI window pops up:
  • From the File drop down menu choose "New sequence".
  • As Filename choose MyEPI.xml and save.

You will now see the minimum requirements for a sequence: the top node ConcatSequence (outer most loop) of the sequence, C1, short ConcatSequence, and Parameters node, P. Let us start with the parameters. The parameters hold information valid for the whole sequence. These include in order from top left to bottom right: name, FOV in x, y, and z direction,maximum gradient amplitude, maximum slewrate, TD, TE, TI, and TR. Note that these values do not do anything as long as they are not used by the sequence. The parameter node is merely a collection of values to be used by other modules.

  • Click on the parameter node P
  • Set FOVx and FOVy to 200 each.
  • Set GradMaxAmpl to 5.
  • Set GradSlewRate to 20.
  • Set Nx and Ny to 64 each.
  • Set TE to 50.
  • Set TR to 100.
  • Click on "write XML"

Note that the last step has to be done always in order to apply unsaved changes. Do this always in order to see the effect of a change.

Let us now model the sequence.

  • Click on the concat sequence C1

Since we do not want to loop over the EPI readout, you do not need to change any of the parameters of C1.

We want to start with inserting the excitation pulse. Pulses, which are played out simultaneously are contained in atomic sequences.

  • Click in the selection bar on the symbol for atomic sequences A.
  • Click on C1 and the atom will be appended.

An atomic sequence is appended to C1 by the name of A1.

Since we do not care for slice selection for this tutorial, we now insert a hard RF pulse.

  • Click in the module bar on the symbol for the hard RF pulses.

When you hover over the fields a short description is shown for every module.

  • Click on A1 to append the pulse to the excitation atomic sequence.
  • Set Duration to 1 for 1ms.
  • Set FlipAngle to 90 for 90 degrees.

Your sequence should, so far, look like this:

Note the "jemris tree dump" at the bottom of the window. It shows the jemris output of the sequence. Any error messages due to incorrect or insufficient module attributes will show up here.

The excitation is now sufficiently defined. We now need to insert into the sequence the dephasers in read as well as PE directions. For this purpose the next atom needs to be added after the A1 atom.

  • Select from the symbol bar the symbol for atomic sequences.
  • Click on C1 to insert the atom after A1.
  • Choose from the symbol bar the symbol for trapezoidal gradients.
  • Click on A2 to insert it therein.
  • Change its axis to GX
  • Repeat the last three steps for the phase encoding dephaser, with axis GY in the last step

The dephasing areas will be chosen as half the size of k-space. These values can be obtained from the parameters node, which defines the image resolution. For that, the gradients have to observe the according parameters (cf. section Analytical expressions):

  • Click on the first dephaser P2
  • Set Observe to A=P.KMAXx
  • Set Area to -A

Do the same for dephaser P2 (using the parameter P.KMAXy).
We will later define the EPI readout along the x-axis. Then, we will see that the above definition of the dephaser P1 was not fully exact and we have to change it.

Next we need to introduce a dead time to match the center of the EPI readout with TE from the parameters.

  • Choose the symbol for a delay atomic sequence from the module bar.
  • Click on C1 to add it to the sequence. You will find details on delays here: Sequence Modules. Start preparing the delay D1 by observing the attribute TE of the parameter node:
  • Click on the delay D1
  • Set Observe to TE=P.TE
  • Set the Delay to TE
  • Set the StartSeq to A1 The StopSeq will be defined later, once we have created the EPI readout.

You should be looking at a sequence representation looking as follows:

Let us now compose the EPI readout. For this, we would like to implement a loop structure for one readout line and one phase encoding blip to run through all phase encoding steps.

  • Click on the symbol of a concat sequence in the module bar.
  • Add it to the sequence by clicking on C1.
  • Click on the new concat sequence C2 (the EPI loop)
  • Set Observe to N=P.Ny
  • Set Repetitions to N
  • Add two atomic sequences to C2, one for the readout and one for the blips.
  • Add to each atomic sequence, A3 and A4, one trapezoidal gradient (P4 and P5) and change their Axis to GX and GY, respectively.

We have to define the FlatTopArea and the number of sampling points on the flat top of the readout gradient P4:

  • Click on the gradient P4
  • Set Observe to A=P.KMAXx, C=C2.Counter,N=P.Nx
  • Set ADCs to N
  • Set FlatTopArea to2*A*(-1)^C
  • Set FlatTopTime to 1

Thus, the flat top has a fixed duration of 1ms. Area and polarity will be set according to the defined formula. By observing the loop counter, the polarity will toggle between even and odd lines in k-space. (Note: loop counters always start at zero in jemris!)

Next, define the Area of the PE blip P5. This is a simple assignment, observing the parameter attribute for k-space increment:

  • Click on the gradient P5
  • Set Observe to A=P.DKy.
  • Set Area to A.

The following image reflects the content of the sequence GUI up to this point:

We are nearly done, this is already close to a working EPI sequence. However, if you look at the k-space encoding (select "sequence Diagram" and "k-space trajectory"), you will notice that the readout encoding is not exactly symmetrical to k-space center. For that the dephaser area needs to be exactly half the size of the readout gradient. Let's correct that:

  • Click on the first dephaser P2
  • Change Observe to A=P4.Area
  • Change Area to -abs(A)/2

Here, "-abs()" was used to ensure negative polarity of the dephaser, as the readout gradient area, P4.Area, starts with a positive readout.
(Note that every change of the readout polarity will notify the dephaser to update its area. This is a consequence of the built-in observe-notify mechanism of JEMRIS modules. It has no effect in this example but is useful in others, e.g. to automatically set the area of a phase encode rewinder.)

Let us now define the missing parameters of the delay D1, to ensure that the delay time TE is counted from center to center (C2C) between RF pulse and EPI readout:

  • Click on the delay atom D1
  • Set the DelayType to C2C.
  • Set StopSeq to C2.

Finally, we add a delay to the end of the sequence to define the TR of the sequence:

  • Choose from the module bar the symbol for an DelayAtomicSequence.
  • Click on C1 to append it to the sequence.
  • Set DelayTape to B2E.
  • Set Observe to TR=P.TR.
  • Set Delay to TR.
  • Set StartSeq to A1.

We are done with the EPI sequence.

Let us, finally, have a look at the EPI sequence, the associated sequence diagram, and the k-space trajectory reflecting the data acquisition scheme in the following three images.

The following image reflects the sequence GUI up to this point:

Click now on the check box "Sequence Diagram" at the top to see the sequence diagram:

Click now on the check box "k-space trajecory" and then "add ADCs" to verify the k-space trajectory and sampling of the EPI sequence:

Let us go on to simulate the sequence: First steps tutorial - simulation

-- last change 03.10.2023 | Tony Stoecker | Imprint | Data Protection --