:orphan:

Example gallery
===============

The examples below show some common use cases for SplineBox.
Feel free to submit example use cases via `GitHub Issues <https://github.com/EPFL-Center-for-Imaging/splinebox/issues/new>`_ or a pull request if you'd like them to be featured on our documentation website!



.. raw:: html

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

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this example, we add noise to a sinusoidal signal and then approximate it using an exponential spline.">

.. only:: html

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

  :ref:`sphx_glr_auto_examples_plot_sin.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Approximating a Noisy Signal</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this example, we plot the curvature comb of a 2D spline. Calculating curvature requires computing the second derivative, which can be sensitive to noise when using numerical methods. Splines are particularly useful in this context because their derivatives can be computed analytically using the chain rule, resulting in smoother and more accurate curvature calculations.">

.. only:: html

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

  :ref:`sphx_glr_auto_examples_plot_curvature_combs.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Curvature combs</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Saving and loading splines">

.. only:: html

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

  :ref:`sphx_glr_auto_examples_plot_io.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Saving and loading splines</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how the background of the splinebox documentation is made.">

.. only:: html

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

  :ref:`sphx_glr_auto_examples_plot_background.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Generate the splinebox documentation background</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how the choice of basis function influences the shape of a spline. We use a fixed set of knots and construct splines using different basis functions to observe their effects.">

.. only:: html

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

  :ref:`sphx_glr_auto_examples_plot_example1.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Closed interpolating splines</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example compares splinebox and scipy when trying to approximate a contour/shape with a closed spline with a fixe number of control points.">

.. only:: html

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

  :ref:`sphx_glr_auto_examples_plot_splinebox_vs_scipy_coin.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Comparison splinebox and scipy: contour approximation</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="`Moving frames`_ provide a local coordinate system along a curve. This system can be used to analyze the space around points on the curve, such as extracting orthogonal images from a volume. An example of this application is the Dendrite-Centric Coordinate System.">

.. only:: html

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

  :ref:`sphx_glr_auto_examples_plot_frame.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Moving Frames</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this example, we compute the euclidean distance between two splines.">

.. only:: html

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

  :ref:`sphx_glr_auto_examples_plot_distance.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Distance between splines</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates a basic active contours (snakes) implementation using splinebox. The goal is to segment the astronaut&#x27;s head in an image by iteratively refining a spline contour.">

.. only:: html

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

  :ref:`sphx_glr_auto_examples_plot_active_contours.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Active Contours</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this example, we measure the curvature of a peptide in an AFM image.">

.. only:: html

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

  :ref:`sphx_glr_auto_examples_plot_peptides.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Measure the curvature of a peptide</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Spline to mesh">

.. only:: html

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

  :ref:`sphx_glr_auto_examples_plot_mesh.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Spline to mesh</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example compares the performance of splinebox and scipy when fitting a spline to an image feature, in this case, an integral symbol in a cropped section of an image.">

.. only:: html

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

  :ref:`sphx_glr_auto_examples_plot_splinebox_vs_scipy_line.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Comparison of splinebox and scipy: Edge Fitting</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Data Source: WormSwin">

.. only:: html

  .. image:: /auto_examples/images/thumb/sphx_glr_plot_celegans_thumb.gif
    :alt:

  :ref:`sphx_glr_auto_examples_plot_celegans.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Tracking the Undulating Motion of C. elegans</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Data Source: DeepD3 Data Used: Crop of DeepD3_Benchmark.tif">

.. only:: html

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

  :ref:`sphx_glr_auto_examples_plot_dendrite.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Dendrite-Centric Coordinate System</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this example, we will compare the performance of splinebox against scipy in three tasks:">

.. only:: html

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

  :ref:`sphx_glr_auto_examples_plot_performance_comparison_with_scipy.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Performance Comparison: splinebox vs scipy</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/plot_sin
   /auto_examples/plot_curvature_combs
   /auto_examples/plot_io
   /auto_examples/plot_background
   /auto_examples/plot_example1
   /auto_examples/plot_splinebox_vs_scipy_coin
   /auto_examples/plot_frame
   /auto_examples/plot_distance
   /auto_examples/plot_active_contours
   /auto_examples/plot_peptides
   /auto_examples/plot_mesh
   /auto_examples/plot_splinebox_vs_scipy_line
   /auto_examples/plot_celegans
   /auto_examples/plot_dendrite
   /auto_examples/plot_performance_comparison_with_scipy


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