
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "generated/gallery/10-gradient-echo/gre2D_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_gre2D_sequence.py>`
        to download the full example code.

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

.. _sphx_glr_generated_gallery_10-gradient-echo_gre2D_sequence.py:


============================
2D Cartesian gradient echo
============================

A spoiled gradient-echo (SPGR) acquisition applies one low-flip-angle
slice-selective excitation before an unbalanced Cartesian readout in each TR.
Gradient spoiling and quadratic RF/receiver phase cycling suppress coherent
residual transverse magnetisation. TR and flip angle primarily determine T1
weighting, with T2* decay during TE. SPGR is widely used for T1-weighted
structural imaging.

.. GENERATED FROM PYTHON SOURCE LINES 13-33








.. GENERATED FROM PYTHON SOURCE LINES 34-38

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

Every phase-encode line of one slice is acquired.

.. GENERATED FROM PYTHON SOURCE LINES 38-49

.. code-block:: Python


    import pypulseqpp as pp
    from pypulseqpp.sequences import gre2D_sequence

    baseline = gre2D_sequence(n_x=192, n_y=192, n_slices=1, te=None, tr=None, n_dummy=0)
    print(f"{baseline.num_blocks} blocks, {baseline.duration()[0]:.2f} s")
    print(
        f"TE {baseline.get_definition('TE')[0] * 1e3:.2f} ms, "
        f"TR {baseline.get_definition('TR')[0] * 1e3:.2f} ms"
    )





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

 .. code-block:: none

    960 blocks, 1.83 s
    TE 4.02 ms, TR 9.54 ms




.. GENERATED FROM PYTHON SOURCE LINES 50-52

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

.. GENERATED FROM PYTHON SOURCE LINES 52-55

.. code-block:: Python


    baseline.paper_plot()




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





.. GENERATED FROM PYTHON SOURCE LINES 56-61

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

The acquisition order places central k-space near the temporal midpoint of
the scan. Colour encodes repetition index.

.. GENERATED FROM PYTHON SOURCE LINES 61-64

.. 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_gre2D_sequence_002.png
   :alt: gre2D sequence
   :srcset: /generated/gallery/10-gradient-echo/images/sphx_glr_gre2D_sequence_002.png
   :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 65-71

In-plane acceleration
---------------------

``ry=2`` acquires one phase-encode line in two and adds a fully sampled
calibration region at the centre of k-space, from which a parallel-imaging
reconstruction estimates the coil sensitivities.

.. GENERATED FROM PYTHON SOURCE LINES 71-85

.. code-block:: Python


    alternative = gre2D_sequence(
        n_x=192, n_y=192, n_slices=1, ry=2, n_acs_y=24, te=None, tr=None, n_dummy=0
    )






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

 .. code-block:: none

                       blocks  duration (s)  acquisitions
    full                  960          1.83           192
    ry = 2                540          1.03           108




.. GENERATED FROM PYTHON SOURCE LINES 86-88

.. 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_gre2D_sequence_003.png
   :alt: gre2D sequence
   :srcset: /generated/gallery/10-gradient-echo/images/sphx_glr_gre2D_sequence_003.png
   :class: sphx-glr-single-img






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

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


.. _sphx_glr_download_generated_gallery_10-gradient-echo_gre2D_sequence.py:

.. only:: html

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

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

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

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

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

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

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


.. only:: html

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

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