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

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

.. _sphx_glr_generated_gallery_11-spin-echo_se_spiral2D_sequence.py:


=====================
2D spiral spin echo
=====================

A slice-selective excitation and 180-degree refocusing pulse form one spin echo,
followed by a spiral interleaf. Spoilers suppress unwanted coherence before
the next TR. TE controls T2 weighting; off-resonance affects the spiral
readout. Spiral spin echo supports rapid T2-weighted structural imaging.

.. GENERATED FROM PYTHON SOURCE LINES 11-31








.. GENERATED FROM PYTHON SOURCE LINES 32-36

Constant-density spiral
-----------------------

Sixteen interleaves at a constant pitch.

.. GENERATED FROM PYTHON SOURCE LINES 36-46

.. code-block:: Python


    import pypulseqpp as pp
    from pypulseqpp.sequences import se_spiral2D_sequence

    baseline = se_spiral2D_sequence(
        n=192, n_shots=16, n_slices=1, te=None, 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

    112 blocks, 0.40 s




.. GENERATED FROM PYTHON SOURCE LINES 47-49

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

.. GENERATED FROM PYTHON SOURCE LINES 49-52

.. code-block:: Python


    baseline.paper_plot()




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





.. GENERATED FROM PYTHON SOURCE LINES 53-58

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

Each interleaf is the same spiral gradient waveform, rotated to its own
angle by a rotation extension.

.. GENERATED FROM PYTHON SOURCE LINES 58-61

.. code-block:: Python


    pp.plot.plot_kspace(baseline, color_by="shot", plane="xy")




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





.. GENERATED FROM PYTHON SOURCE LINES 62-67

Variable density
----------------

A dual-density interleaf retains the Nyquist spacing near the origin and increases
the pitch at larger radii, reducing the readout duration.

.. GENERATED FROM PYTHON SOURCE LINES 67-88

.. code-block:: Python


    alternative = se_spiral2D_sequence(
        n=192,
        n_shots=16,
        n_slices=1,
        density="dual",
        periphery_undersampling=2.0,
        te=None,
        tr=None,
        n_dummy=0,
    )






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

 .. code-block:: none

                       blocks  duration (s)  acquisitions
    constant              112          0.40            16
    dual density          112          0.35            16




.. GENERATED FROM PYTHON SOURCE LINES 89-91

.. code-block:: Python

    pp.plot.plot_kspace(alternative, color_by="shot", plane="xy")




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






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

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


.. _sphx_glr_download_generated_gallery_11-spin-echo_se_spiral2D_sequence.py:

.. only:: html

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

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

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

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

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

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

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


.. only:: html

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

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