
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "examples/imageseq.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        Click :ref:`here <sphx_glr_download_examples_imageseq.py>`
        to download the full example code

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

.. _sphx_glr_examples_imageseq.py:


ImageSequences
==============

.. GENERATED FROM PYTHON SOURCE LINES 6-38

.. code-block:: default


    from neo.core import ImageSequence
    from neo.core import RectangularRegionOfInterest, CircularRegionOfInterest, PolygonRegionOfInterest
    import matplotlib.pyplot as plt
    import quantities as pq

    import random

    # generate data

    l = []
    for frame in range(50):
        l.append([])
        for y in range(100):
            l[frame].append([])
            for x in range(100):
                l[frame][y].append(random.randint(0, 50))

    image_seq = ImageSequence(l, sampling_rate=500 * pq.Hz, spatial_scale='m', units='V')

    result = image_seq.signal_from_region(CircularRegionOfInterest(50, 50, 25),
                                          CircularRegionOfInterest(10, 10, 5),
                                          PolygonRegionOfInterest((50, 25), (50, 45), (14, 65),
                                                                  (90, 80)))

    for i in range(len(result)):
        plt.figure()
        plt.plot(result[i].times, result[i])
        plt.xlabel("seconde")
        plt.ylabel("valeur")

    plt.show()


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

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


.. _sphx_glr_download_examples_imageseq.py:

.. only:: html

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


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

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

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

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


.. only:: html

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

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