
.. 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_multiecho3D_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_multiecho3D_sequence.py>`
        to download the full example code.

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

.. _sphx_glr_generated_gallery_10-gradient-echo_gre_multiecho3D_sequence.py:


=======================================
3D Cartesian multi-echo gradient echo
=======================================

A slab-selective spoiled excitation is followed by several gradient echoes of
one Cartesian ``(line, partition)`` view. Gradient and RF spoiling suppress
residual transverse coherence between repetitions. The multiple echo times
sample T2* decay; TR and flip angle determine the T1 weighting. Applications
include high-resolution structural imaging, R2* mapping, and QSM.

.. GENERATED FROM PYTHON SOURCE LINES 12-32








.. GENERATED FROM PYTHON SOURCE LINES 33-38

Fully sampled acquisition
-------------------------

Four echoes per excitation, over every ``(line, partition)`` view inside
the ellipse inscribed in the phase-encode plane.

.. GENERATED FROM PYTHON SOURCE LINES 38-48

.. code-block:: Python


    import pypulseqpp as pp
    from pypulseqpp.sequences import gre_multiecho3D_sequence

    baseline = gre_multiecho3D_sequence(
        n_x=160, n_y=160, n_z=32, n_echoes=4, tr=None, n_dummy=0
    )
    print(f"{baseline.num_blocks} blocks, {baseline.duration()[0]:.2f} s")






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

 .. code-block:: none

    39950 blocks, 52.89 s




.. 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_multiecho3D_sequence_001.png
   :alt: gre multiecho3D sequence
   :srcset: /generated/gallery/10-gradient-echo/images/sphx_glr_gre_multiecho3D_sequence_001.png
   :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 55-59

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

Colour encodes acquisition order in the phase-encode plane.

.. GENERATED FROM PYTHON SOURCE LINES 59-62

.. code-block:: Python


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




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





.. GENERATED FROM PYTHON SOURCE LINES 63-68

Acceleration on both encoded axes
---------------------------------

Subsampling both phase-encode axes reduces the number of repetitions. The
complete echo train remains within each retained repetition.

.. GENERATED FROM PYTHON SOURCE LINES 68-82

.. code-block:: Python


    alternative = gre_multiecho3D_sequence(
        n_x=160, n_y=160, n_z=32, n_echoes=4, ry=2, rz=2, tr=None, n_dummy=0
    )






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

 .. code-block:: none

                       blocks  duration (s)  acquisitions
    full                39950         52.89         15980
    2 x 2               12790         16.93          5116




.. GENERATED FROM PYTHON SOURCE LINES 83-85

.. code-block:: Python

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




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






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

   **Total running time of the script:** (2 minutes 57.028 seconds)


.. _sphx_glr_download_generated_gallery_10-gradient-echo_gre_multiecho3D_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_multiecho3D_sequence.ipynb <gre_multiecho3D_sequence.ipynb>`

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

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

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

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


.. only:: html

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

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