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

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

.. _sphx_glr_generated_gallery_11-spin-echo_se3D_sequence.py:


========================
3D Cartesian spin echo
========================

A slab-selective excitation and 180-degree refocusing pulse form one spin echo,
followed by a Cartesian ``(line, partition)`` readout. Spoilers suppress
unwanted coherence before the next TR. TE and TR determine T2 and longitudinal
recovery weighting. 3D spin echo supports high-resolution structural imaging.

.. GENERATED FROM PYTHON SOURCE LINES 11-31








.. GENERATED FROM PYTHON SOURCE LINES 32-37

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

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

.. GENERATED FROM PYTHON SOURCE LINES 37-45

.. code-block:: Python


    import pypulseqpp as pp
    from pypulseqpp.sequences import se3D_sequence

    baseline = se3D_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")






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

 .. code-block:: none

    31960 blocks, 53.45 s




.. GENERATED FROM PYTHON SOURCE LINES 46-48

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

.. GENERATED FROM PYTHON SOURCE LINES 48-51

.. code-block:: Python


    baseline.paper_plot()




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





.. GENERATED FROM PYTHON SOURCE LINES 52-56

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

Colour encodes acquisition order in the phase-encode plane.

.. GENERATED FROM PYTHON SOURCE LINES 56-59

.. code-block:: Python


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




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





.. GENERATED FROM PYTHON SOURCE LINES 60-66

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

Subsampling lines and partitions by two each reduces the number of
repetitions approximately fourfold outside the calibration region. Each
acquired view has the prescribed echo time.

.. GENERATED FROM PYTHON SOURCE LINES 66-80

.. code-block:: Python


    alternative = se3D_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                31960         53.45          3995
    2 x 2               10232         17.11          1279




.. GENERATED FROM PYTHON SOURCE LINES 81-83

.. code-block:: Python

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




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






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

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


.. _sphx_glr_download_generated_gallery_11-spin-echo_se3D_sequence.py:

.. only:: html

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

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

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

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

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

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

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


.. only:: html

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

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