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

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

.. _sphx_glr_generated_gallery_11-spin-echo_se2D_sequence.py:


========================
2D Cartesian spin echo
========================

A slice-selective excitation and 180-degree refocusing pulse form one spin echo,
followed by a Cartesian readout. Spoilers suppress unwanted coherence before
the next TR. TE controls T2 weighting and TR controls longitudinal recovery.
Spin echo is used for conventional T1-, T2-, and proton-density-weighted
structural imaging.

.. GENERATED FROM PYTHON SOURCE LINES 12-32








.. GENERATED FROM PYTHON SOURCE LINES 33-38

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

Every phase-encode line of one slice is acquired, at the minimum echo time
permitted by the RF pulse and readout durations.

.. GENERATED FROM PYTHON SOURCE LINES 38-49

.. code-block:: Python


    import pypulseqpp as pp
    from pypulseqpp.sequences import se2D_sequence

    baseline = se2D_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

    1536 blocks, 3.59 s
    TE 13.16 ms, TR 18.68 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/11-spin-echo/images/sphx_glr_se2D_sequence_001.png
   :alt: se2D sequence
   :srcset: /generated/gallery/11-spin-echo/images/sphx_glr_se2D_sequence_001.png
   :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 56-60

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

Colour encodes phase-encode line acquisition order.

.. 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/11-spin-echo/images/sphx_glr_se2D_sequence_002.png
   :alt: se2D sequence
   :srcset: /generated/gallery/11-spin-echo/images/sphx_glr_se2D_sequence_002.png
   :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 64-70

Partial Fourier
---------------

``partial_fourier_y`` omits high-spatial-frequency lines on one side of
k-space. Partial-Fourier reconstruction uses conjugate symmetry and requires
a phase estimate; the reduced acquisition time is accompanied by an SNR penalty.

.. GENERATED FROM PYTHON SOURCE LINES 70-84

.. code-block:: Python


    alternative = se2D_sequence(
        n_x=192, n_y=192, n_slices=1, partial_fourier_y=0.75, te=None, tr=None, n_dummy=0
    )






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

 .. code-block:: none

                       blocks  duration (s)  acquisitions
    full                 1536          3.59           192
    6/8 along y          1152          2.69           144




.. GENERATED FROM PYTHON SOURCE LINES 85-87

.. code-block:: Python

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




.. image-sg:: /generated/gallery/11-spin-echo/images/sphx_glr_se2D_sequence_003.png
   :alt: se2D sequence
   :srcset: /generated/gallery/11-spin-echo/images/sphx_glr_se2D_sequence_003.png
   :class: sphx-glr-single-img






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

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


.. _sphx_glr_download_generated_gallery_11-spin-echo_se2D_sequence.py:

.. only:: html

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

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

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

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

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

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

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


.. only:: html

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

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