:orphan:

########
Examples
########

.. warning::

    If you want to run the examples, make sure you execute them in a directory
    where you have write permissions, or you copy the examples into such a
    directory. If you install fmralign manually, make sure you have followed
    the instructions.



.. raw:: html

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

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this tutorial, we show how to improve inter-subject similarity using a template computed across multiple source subjects. For this purpose, we leverage GroupAlignment to create a template, using Procrustes alignment. Leveraging the learned template, we align the target subject using shared information. We then compare the voxelwise similarity between the target subject and the template to the similarity between the target subject and the anatomical Euclidean average of the source subjects.">

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_group_alignment_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_plot_group_alignment.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Template-based prediction.</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="We mostly rely on python common packages and on nilearn to handle functional data in a clean fashion.">

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_pairwise_alignment_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_plot_pairwise_alignment.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Pairwise functional alignment.</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this tutorial, we focus here on a single Region of Interest (ROI). On this ROI, we try to find a transformation from source to target subject that captures the variability between their signal on data they share. We then use this transformation to predict new contrasts for the target subject.">

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_pairwise_roi_alignment_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_plot_pairwise_roi_alignment.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Pairwise functional alignment on a ROI.</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="We mostly rely on python common packages and on nilearn to handle functional data in a clean fashion.">

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_alignment_methods_benchmark_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_plot_alignment_methods_benchmark.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Alignment methods benchmark (template-based ROI case)</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this tutorial, we show how to align surface data from two subjects using a pairwise alignment method. We project the data on the fsaverage5 surface and learn a piecewise mapping from one subject to the other using ward clustering.">

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_surf_alignment_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_plot_surf_alignment.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Pairwise surface alignment.</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In aligning, we search for a transformation, let&#x27;s call it R, between the source subject data X and the target data Y. X and Y are arrays of dimensions (n_voxels, n_samples) where each image is a sample. So we can see each signal as a distribution where each voxel as a point in a multidimensional functional space (each dimension is a sample).">

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_alignment_simulated_2D_data_thumb.png
    :alt:

  :ref:`sphx_glr_auto_examples_plot_alignment_simulated_2D_data.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Alignment on simulated 2D data.</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_group_alignment
   /auto_examples/plot_pairwise_alignment
   /auto_examples/plot_pairwise_roi_alignment
   /auto_examples/plot_alignment_methods_benchmark
   /auto_examples/plot_surf_alignment
   /auto_examples/plot_alignment_simulated_2D_data


.. 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>`_
