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

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

.. _sphx_glr_generated_gallery_10-gradient-echo_gre3D_sequence.py:


============================
3D Cartesian gradient echo
============================

A 3D spoiled gradient-echo (SPGR) acquisition applies a low-flip-angle slab
excitation before one Cartesian ``(line, partition)`` readout per TR. Gradient
spoiling and quadratic RF/receiver phase cycling suppress coherent residual
transverse magnetisation. TR, flip angle, and TE determine the T1 and T2*
weighting. This sequence is used for high-resolution T1-weighted structural
imaging.

.. GENERATED FROM PYTHON SOURCE LINES 13-33








.. GENERATED FROM PYTHON SOURCE LINES 34-39

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

Every ``(line, partition)`` view inside the ellipse inscribed in the
phase-encode plane is acquired.

.. GENERATED FROM PYTHON SOURCE LINES 39-47

.. code-block:: Python


    import pypulseqpp as pp
    from pypulseqpp.sequences import gre3D_sequence

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





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

 .. code-block:: none

    15980 blocks, 26.77 s
    TR 6.70 ms




.. GENERATED FROM PYTHON SOURCE LINES 48-50

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

.. GENERATED FROM PYTHON SOURCE LINES 50-53

.. code-block:: Python


    baseline.paper_plot()




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





.. GENERATED FROM PYTHON SOURCE LINES 54-59

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

Colour encodes acquisition order in the phase-encode plane. All lines of
one partition are acquired before the next partition.

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





.. GENERATED FROM PYTHON SOURCE LINES 63-70

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

``ry`` and ``rz`` subsample the line and partition axes independently.
With ``ry=rz=2``, the phase-encode plane outside the central calibration
region is acquired in approximately one quarter of the repetitions; the
calibration region remains fully sampled.

.. GENERATED FROM PYTHON SOURCE LINES 70-84

.. code-block:: Python


    alternative = gre3D_sequence(
        n_x=160, n_y=160, n_z=32, ry=2, rz=2, te=None, tr=None, n_dummy=0
    )






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

 .. code-block:: none

                       blocks  duration (s)  acquisitions
    full                15980         26.77          3995
    2 x 2                5116          8.57          1279




.. GENERATED FROM PYTHON SOURCE LINES 85-87

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






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

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


.. _sphx_glr_download_generated_gallery_10-gradient-echo_gre3D_sequence.py:

.. only:: html

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

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

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

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

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

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

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


.. only:: html

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

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