:orphan:

# Examples

The examples are placeholders, to be written: each page states what it will
show.  The sections follow the workflow in order: BART's applications,
encoding operators, an application assembled from operators, and
reconstructions.

For the operator inventory and advanced methods, see {doc}`/gallery/encoding`,
{doc}`/gallery/research` and {doc}`/gallery/learning_resources`.



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. thumbnail-parent-div-close

.. raw:: html

    </div>

## Applications

Phantoms, FFTs and calibration, then coil preparation by prewhitening and
compression.  BART's commands keep the coil axis where BART puts it.



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="To be written: a phantom, a unitary Fourier round trip with bartorch.fft, and ESPIRiT sensitivities from tools.ecalib.">

.. only:: html

  .. image:: /auto_examples/01_tools/images/thumb/sphx_glr_plot_01_quickstart_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_01_tools_plot_01_quickstart.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Phantom, Fourier transform and calibration</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="To be written: noise prewhitening with tools.whiten, coil compression with tools.cc and tools.ccapply, and calibration in the compressed coil space.">

.. only:: html

  .. image:: /auto_examples/01_tools/images/thumb/sphx_glr_plot_02_coil_preparation_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_01_tools_plot_02_coil_preparation.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Prewhitening, coil compression and sensitivity maps</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>

## Encoding operators

Operators with explicit domain and codomain shapes.  Check the adjoint before
using an encoding inside a solver.



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="To be written: sensitivities, a centred unitary FFT and sampling composed into one operator, checked against torch&#x27;s FFT and the complex adjoint identity.">

.. only:: html

  .. image:: /auto_examples/02_encoding/images/thumb/sphx_glr_plot_01_cartesian_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_02_encoding_plot_01_cartesian.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">A Cartesian encoding and its adjoint</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="To be written: a radial trajectory and linop.NUFFT, checked against the explicit Fourier sum.">

.. only:: html

  .. image:: /auto_examples/02_encoding/images/thumb/sphx_glr_optional_02_noncartesian_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_02_encoding_optional_02_noncartesian.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Radial encoding and a direct Fourier reference</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="To be written: known shot phases and interleaved phase-encode masks as BART operators, solved with optim.CG.">

.. only:: html

  .. image:: /auto_examples/02_encoding/images/thumb/sphx_glr_plot_03_epi_shots_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_02_encoding_plot_03_epi_shots.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">An idealized multi-shot EPI encoding</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="To be written: a hybrid-space wave model with readout padding and a temporal basis, assembled from operators.">

.. only:: html

  .. image:: /auto_examples/02_encoding/images/thumb/sphx_glr_plot_04_wave_subspace_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_02_encoding_plot_04_wave_subspace.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Wave encoding and temporal subspaces</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>

## An application from operators

BART operators and a Python callback composed into an encoding, solved
without shell commands or CFL files.



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="To be written: a Python-defined operator composed with BART&#x27;s FFT and solved with optim.CG.">

.. only:: html

  .. image:: /auto_examples/03_apps/images/thumb/sphx_glr_plot_01_custom_app_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_03_apps_plot_01_custom_app.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">A reconstruction with a Python operator</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>

## Reconstructions

Parallel imaging, model-based parameter mapping, and a small DeepInverse
learning example.  Measured-data reproductions are described in the
{doc}`research recipes </gallery/research>`.



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="To be written: calibration from a fully sampled centre, retrospective undersampling, and tools.pics.">

.. only:: html

  .. image:: /auto_examples/04_applications/images/thumb/sphx_glr_plot_01_parallel_imaging_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_04_applications_plot_01_parallel_imaging.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Parallel imaging with ESPIRiT and PICS</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="To be written: a torch signal model fitted from Fourier data with optim.IRGNM.">

.. only:: html

  .. image:: /auto_examples/04_applications/images/thumb/sphx_glr_plot_02_model_based_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_04_applications_plot_02_model_based.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Model-based multi-echo reconstruction</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="To be written: a BART encoding handed to DeepInverse with bartorch.to_deepinv, inside a small trained network.">

.. only:: html

  .. image:: /auto_examples/04_applications/images/thumb/sphx_glr_optional_03_deepinverse_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_04_applications_optional_03_deepinverse.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">DeepInverse physics and a learned reconstruction</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:
   :includehidden:


   /auto_examples/01_tools/index.rst
   /auto_examples/02_encoding/index.rst
   /auto_examples/03_apps/index.rst
   /auto_examples/04_applications/index.rst


.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-gallery

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

      :download:`Download all examples in Python source code: auto_examples_python.zip </auto_examples/auto_examples_python.zip>`

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

      :download:`Download all examples in Jupyter notebooks: auto_examples_jupyter.zip </auto_examples/auto_examples_jupyter.zip>`


.. only:: html

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

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