
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "generated/gallery/10-gradient-echo/gre_multiecho2D_sequence.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_generated_gallery_10-gradient-echo_gre_multiecho2D_sequence.py>`
        to download the full example code.

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_generated_gallery_10-gradient-echo_gre_multiecho2D_sequence.py:


=======================================
2D Cartesian multi-echo gradient echo
=======================================

A spoiled low-flip-angle excitation is followed by several Cartesian gradient
echoes of the same phase-encode line. Gradient and RF spoiling suppress
residual transverse coherence before the next TR. The echo train samples T2*
decay while TR and flip angle determine the T1 weighting. Multi-echo GRE is
used for T2*/R2* mapping, susceptibility mapping, and structural imaging.

.. GENERATED FROM PYTHON SOURCE LINES 12-32








.. GENERATED FROM PYTHON SOURCE LINES 33-38

Four-echo train
---------------

Four echoes after each excitation, with readout gradients of alternating
polarity.

.. GENERATED FROM PYTHON SOURCE LINES 38-48

.. code-block:: Python


    import pypulseqpp as pp
    from pypulseqpp.sequences import gre_multiecho2D_sequence

    baseline = gre_multiecho2D_sequence(
        n_x=192, n_y=192, n_slices=1, n_echoes=4, te=None, tr=None, n_dummy=0
    )
    print(f"{baseline.num_blocks} blocks, {baseline.duration()[0]:.2f} s")
    print("TE", [round(t * 1e3, 2) for t in baseline.get_definition("TE")], "ms")





.. rst-class:: sphx-glr-script-out

 .. code-block:: none

    2112 blocks, 4.54 s
    TE [4.02, 8.7, 13.38, 18.06] ms




.. GENERATED FROM PYTHON SOURCE LINES 49-51

Sequence diagram
----------------

.. GENERATED FROM PYTHON SOURCE LINES 51-54

.. code-block:: Python


    baseline.paper_plot()




.. image-sg:: /generated/gallery/10-gradient-echo/images/sphx_glr_gre_multiecho2D_sequence_001.png
   :alt: gre multiecho2D sequence
   :srcset: /generated/gallery/10-gradient-echo/images/sphx_glr_gre_multiecho2D_sequence_001.png
   :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 55-60

Sampling order
--------------

Colour encodes acquisition order. The echoes of one excitation sample the
same phase-encode line.

.. GENERATED FROM PYTHON SOURCE LINES 60-63

.. code-block:: Python


    pp.plot.plot_kspace(baseline, color_by="order", plane="xy", show_trajectory=False)




.. image-sg:: /generated/gallery/10-gradient-echo/images/sphx_glr_gre_multiecho2D_sequence_002.png
   :alt: gre multiecho2D sequence
   :srcset: /generated/gallery/10-gradient-echo/images/sphx_glr_gre_multiecho2D_sequence_002.png
   :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 64-69

A longer echo train
-------------------

Additional echoes extend the sampled decay curve and increase the minimum
repetition time and final echo time.

.. GENERATED FROM PYTHON SOURCE LINES 69-83

.. code-block:: Python


    alternative = gre_multiecho2D_sequence(
        n_x=192, n_y=192, n_slices=1, n_echoes=8, te=None, tr=None, n_dummy=0
    )






.. rst-class:: sphx-glr-script-out

 .. code-block:: none

                       blocks  duration (s)  acquisitions
    4 echoes             2112          4.54           768
    8 echoes             3648          8.13          1536




.. GENERATED FROM PYTHON SOURCE LINES 84-86

.. code-block:: Python

    pp.plot.plot_kspace(alternative, color_by="order", plane="xy", show_trajectory=False)




.. image-sg:: /generated/gallery/10-gradient-echo/images/sphx_glr_gre_multiecho2D_sequence_003.png
   :alt: gre multiecho2D sequence
   :srcset: /generated/gallery/10-gradient-echo/images/sphx_glr_gre_multiecho2D_sequence_003.png
   :class: sphx-glr-single-img






.. rst-class:: sphx-glr-timing

   **Total running time of the script:** (0 minutes 24.333 seconds)


.. _sphx_glr_download_generated_gallery_10-gradient-echo_gre_multiecho2D_sequence.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: gre_multiecho2D_sequence.ipynb <gre_multiecho2D_sequence.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: gre_multiecho2D_sequence.py <gre_multiecho2D_sequence.py>`

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: gre_multiecho2D_sequence.zip <gre_multiecho2D_sequence.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
