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

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

.. _sphx_glr_generated_gallery_12-mprage_mprage_stack_of_stars3D_sequence.py:


==========================
3D stack-of-stars MPRAGE
==========================

An inversion preparation is followed by a train of low-flip-angle spoiled
radial gradient echoes with Cartesian partition encoding. Each spoke crosses
in-plane k-space centre; spoke and partition order determine the recovery time
of the acquired data within and between inversion cycles. Stack-of-stars
MPRAGE provides T1-weighted 3D structural imaging with radial sampling.

.. GENERATED FROM PYTHON SOURCE LINES 12-68








.. GENERATED FROM PYTHON SOURCE LINES 69-76

Timing structure
----------------

Each cycle comprises inversion, inversion delay, a spoke train at one
partition and a recovery interval. ``ti=None`` and ``tr=None`` use the
shortest timing supported by the modules. Angular undersampling leaves four
spokes per partition and produces a compact timing diagram.

.. GENERATED FROM PYTHON SOURCE LINES 76-89

.. code-block:: Python


    import pypulseqpp as pp
    from pypulseqpp.sequences import mprage_stack_of_stars3D_sequence

    compact = mprage_stack_of_stars3D_sequence(
        n=64, n_z=4, ry=32, ti=None, tr=None, n_dummy=0
    )
    print(
        f"{compact.num_blocks} blocks, {compact.duration()[0]:.2f} s, "
        f"TI {compact.get_definition('TI')[0] * 1e3:.0f} ms, "
        f"TR {compact.get_definition('TR')[0] * 1e3:.0f} ms"
    )





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

 .. code-block:: none

    80 blocks, 0.14 s, TI 7 ms, TR 35 ms




.. GENERATED FROM PYTHON SOURCE LINES 90-92

.. code-block:: Python

    compact.paper_plot()




.. image-sg:: /generated/gallery/12-mprage/images/sphx_glr_mprage_stack_of_stars3D_sequence_001.png
   :alt: mprage stack of stars3D sequence
   :srcset: /generated/gallery/12-mprage/images/sphx_glr_mprage_stack_of_stars3D_sequence_001.png
   :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 93-103

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

Each inversion cycle acquires the spokes of one partition, so the cycle is
constant along each row. Readout index specifies spoke order within the train.
``partition_angle_shift``, ``'golden'`` by default, rotates the spoke set
between partitions so that neighbouring partitions do not share spoke
angles. ``TI`` ends at the first
excitation-pulse centre; the centre of
k-space on its spoke is sampled at ``TI + TE``.

.. GENERATED FROM PYTHON SOURCE LINES 103-112

.. code-block:: Python


    protocol = mprage_stack_of_stars3D_sequence(
        n=192, n_z=16, ry=4, ti=0.9, tr=2.3, n_dummy=0
    )





.. image-sg:: /generated/gallery/12-mprage/images/sphx_glr_mprage_stack_of_stars3D_sequence_002.png
   :alt: mprage stack of stars3D sequence
   :srcset: /generated/gallery/12-mprage/images/sphx_glr_mprage_stack_of_stars3D_sequence_002.png
   :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 113-117

Trajectory
----------

The spokes of every partition, over the three k-space axes, coloured by shot.

.. GENERATED FROM PYTHON SOURCE LINES 117-120

.. code-block:: Python


    pp.plot.plot_kspace(protocol, color_by="shot")




.. image-sg:: /generated/gallery/12-mprage/images/sphx_glr_mprage_stack_of_stars3D_sequence_003.png
   :alt: mprage stack of stars3D sequence
   :srcset: /generated/gallery/12-mprage/images/sphx_glr_mprage_stack_of_stars3D_sequence_003.png
   :class: sphx-glr-single-img






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

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


.. _sphx_glr_download_generated_gallery_12-mprage_mprage_stack_of_stars3D_sequence.py:

.. only:: html

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

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

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

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

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

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

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


.. only:: html

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

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