Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-pannunzio committed Aug 1, 2024
1 parent a8f6ee2 commit e44dae8
Show file tree
Hide file tree
Showing 39 changed files with 360 additions and 173 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,9 @@
# Applying median filter to the calibrated phasor coordinates,
# often multiple times, improves contrast:

# TODO: replace this with a ``phasor_filter`` function?
from skimage.filters import median
from phasorpy.phasor import phasor_filter

for _ in range(2):
real = median(real)
imag = median(imag)
real, imag = phasor_filter(real, imag, method='median', size=3, repeat=2)

# %%
# Pixels with low intensities are commonly excluded from analysis and
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
},
"outputs": [],
"source": [
"# TODO: replace this with a ``phasor_filter`` function?\nfrom skimage.filters import median\n\nfor _ in range(2):\n real = median(real)\n imag = median(imag)"
"from phasorpy.phasor import phasor_filter\n\nreal, imag = phasor_filter(real, imag, method='median', size=3, repeat=2)"
]
},
{
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
150 changes: 141 additions & 9 deletions main/_modules/phasorpy/phasor.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions main/_sources/sg_execution_times.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Computation times
=================
**00:28.853** total execution time for 9 files **from all galleries**:
**00:25.749** total execution time for 9 files **from all galleries**:

.. container::

Expand All @@ -33,28 +33,28 @@ Computation times
- Time
- Mem (MB)
* - :ref:`sphx_glr_tutorials_phasorpy_introduction.py` (``../tutorials/phasorpy_introduction.py``)
- 00:11.479
- 00:08.742
- 0.0
* - :ref:`sphx_glr_tutorials_benchmarks_phasorpy_phasor_from_signal.py` (``../tutorials/benchmarks/phasorpy_phasor_from_signal.py``)
- 00:07.622
- 00:07.593
- 0.0
* - :ref:`sphx_glr_tutorials_phasorpy_components.py` (``../tutorials/phasorpy_components.py``)
- 00:05.377
- 00:05.283
- 0.0
* - :ref:`sphx_glr_tutorials_phasorpy_fret.py` (``../tutorials/phasorpy_fret.py``)
- 00:01.729
- 0.0
* - :ref:`sphx_glr_tutorials_phasorpy_cursors.py` (``../tutorials/phasorpy_cursors.py``)
- 00:01.270
- 00:01.013
- 0.0
* - :ref:`sphx_glr_tutorials_phasorpy_phasorplot.py` (``../tutorials/phasorpy_phasorplot.py``)
- 00:00.695
- 00:00.699
- 0.0
* - :ref:`sphx_glr_tutorials_phasorpy_phasor_from_lifetime.py` (``../tutorials/phasorpy_phasor_from_lifetime.py``)
- 00:00.439
- 00:00.454
- 0.0
* - :ref:`sphx_glr_tutorials_phasorpy_pca.py` (``../tutorials/phasorpy_pca.py``)
- 00:00.193
- 00:00.188
- 0.0
* - :ref:`sphx_glr_tutorials_misc_phasorpy_logo.py` (``../tutorials/misc/phasorpy_logo.py``)
- 00:00.049
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,35 +148,35 @@ and number of threads:
harmonics 1
axis -1
phasor_from_signal 0.057s 1.00
threads 2 0.031s 0.54
phasor_from_signal_fft 0.217s 3.82
scipy_fft 0.232s 4.08
threads 2 0.031s 0.55
phasor_from_signal_fft 0.220s 3.86
scipy_fft 0.236s 4.14
axis 0
phasor_from_signal 0.164s 2.89
threads 2 0.080s 1.41
phasor_from_signal_fft 0.451s 7.94
scipy_fft 0.346s 6.10
phasor_from_signal 0.164s 2.88
threads 2 0.080s 1.40
phasor_from_signal_fft 0.452s 7.95
scipy_fft 0.346s 6.09
axis 2
phasor_from_signal 0.057s 1.00
threads 2 0.031s 0.55
phasor_from_signal_fft 0.215s 3.79
scipy_fft 0.233s 4.11
phasor_from_signal_fft 0.218s 3.83
scipy_fft 0.234s 4.11
harmonics 8
axis -1
phasor_from_signal 0.472s 8.31
threads 2 0.245s 4.32
phasor_from_signal_fft 0.230s 4.05
scipy_fft 0.244s 4.31
phasor_from_signal 0.455s 8.00
threads 2 0.248s 4.35
phasor_from_signal_fft 0.235s 4.13
scipy_fft 0.249s 4.38
axis 0
phasor_from_signal 1.313s 23.13
threads 2 0.656s 11.56
phasor_from_signal_fft 0.457s 8.05
scipy_fft 0.352s 6.20
phasor_from_signal 1.307s 22.96
threads 2 0.653s 11.48
phasor_from_signal_fft 0.454s 7.98
scipy_fft 0.351s 6.17
axis 2
phasor_from_signal 0.463s 8.15
threads 2 0.245s 4.32
phasor_from_signal_fft 0.228s 4.02
scipy_fft 0.245s 4.31
phasor_from_signal 0.456s 8.01
threads 2 0.244s 4.29
phasor_from_signal_fft 0.235s 4.13
scipy_fft 0.251s 4.40
Expand Down Expand Up @@ -254,7 +254,7 @@ when computing large number of harmonics with an optimized FFT function.

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

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


.. _sphx_glr_download_tutorials_benchmarks_phasorpy_phasor_from_signal.py:
Expand Down
4 changes: 2 additions & 2 deletions main/_sources/tutorials/benchmarks/sg_execution_times.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Computation times
=================
**00:07.622** total execution time for 1 file **from tutorials/benchmarks**:
**00:07.593** total execution time for 1 file **from tutorials/benchmarks**:

.. container::

Expand All @@ -33,5 +33,5 @@ Computation times
- Time
- Mem (MB)
* - :ref:`sphx_glr_tutorials_benchmarks_phasorpy_phasor_from_signal.py` (``phasorpy_phasor_from_signal.py``)
- 00:07.622
- 00:07.593
- 0.0
48 changes: 24 additions & 24 deletions main/_sources/tutorials/phasorpy_components.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -604,42 +604,42 @@ of components, A vs C and B vs C:
</style>

<div class="animation">
<img id="_anim_img7d5593deebf6474e83cd4651148e30cf">
<img id="_anim_img75902931552146ba862a7cd68ea69a31">
<div class="anim-controls">
<input id="_anim_slider7d5593deebf6474e83cd4651148e30cf" type="range" class="anim-slider"
<input id="_anim_slider75902931552146ba862a7cd68ea69a31" type="range" class="anim-slider"
name="points" min="0" max="1" step="1" value="0"
oninput="anim7d5593deebf6474e83cd4651148e30cf.set_frame(parseInt(this.value));">
oninput="anim75902931552146ba862a7cd68ea69a31.set_frame(parseInt(this.value));">
<div class="anim-buttons">
<button title="Decrease speed" aria-label="Decrease speed" onclick="anim7d5593deebf6474e83cd4651148e30cf.slower()">
<button title="Decrease speed" aria-label="Decrease speed" onclick="anim75902931552146ba862a7cd68ea69a31.slower()">
<i class="fa fa-minus"></i></button>
<button title="First frame" aria-label="First frame" onclick="anim7d5593deebf6474e83cd4651148e30cf.first_frame()">
<button title="First frame" aria-label="First frame" onclick="anim75902931552146ba862a7cd68ea69a31.first_frame()">
<i class="fa fa-fast-backward"></i></button>
<button title="Previous frame" aria-label="Previous frame" onclick="anim7d5593deebf6474e83cd4651148e30cf.previous_frame()">
<button title="Previous frame" aria-label="Previous frame" onclick="anim75902931552146ba862a7cd68ea69a31.previous_frame()">
<i class="fa fa-step-backward"></i></button>
<button title="Play backwards" aria-label="Play backwards" onclick="anim7d5593deebf6474e83cd4651148e30cf.reverse_animation()">
<button title="Play backwards" aria-label="Play backwards" onclick="anim75902931552146ba862a7cd68ea69a31.reverse_animation()">
<i class="fa fa-play fa-flip-horizontal"></i></button>
<button title="Pause" aria-label="Pause" onclick="anim7d5593deebf6474e83cd4651148e30cf.pause_animation()">
<button title="Pause" aria-label="Pause" onclick="anim75902931552146ba862a7cd68ea69a31.pause_animation()">
<i class="fa fa-pause"></i></button>
<button title="Play" aria-label="Play" onclick="anim7d5593deebf6474e83cd4651148e30cf.play_animation()">
<button title="Play" aria-label="Play" onclick="anim75902931552146ba862a7cd68ea69a31.play_animation()">
<i class="fa fa-play"></i></button>
<button title="Next frame" aria-label="Next frame" onclick="anim7d5593deebf6474e83cd4651148e30cf.next_frame()">
<button title="Next frame" aria-label="Next frame" onclick="anim75902931552146ba862a7cd68ea69a31.next_frame()">
<i class="fa fa-step-forward"></i></button>
<button title="Last frame" aria-label="Last frame" onclick="anim7d5593deebf6474e83cd4651148e30cf.last_frame()">
<button title="Last frame" aria-label="Last frame" onclick="anim75902931552146ba862a7cd68ea69a31.last_frame()">
<i class="fa fa-fast-forward"></i></button>
<button title="Increase speed" aria-label="Increase speed" onclick="anim7d5593deebf6474e83cd4651148e30cf.faster()">
<button title="Increase speed" aria-label="Increase speed" onclick="anim75902931552146ba862a7cd68ea69a31.faster()">
<i class="fa fa-plus"></i></button>
</div>
<form title="Repetition mode" aria-label="Repetition mode" action="#n" name="_anim_loop_select7d5593deebf6474e83cd4651148e30cf"
<form title="Repetition mode" aria-label="Repetition mode" action="#n" name="_anim_loop_select75902931552146ba862a7cd68ea69a31"
class="anim-state">
<input type="radio" name="state" value="once" id="_anim_radio1_7d5593deebf6474e83cd4651148e30cf"
<input type="radio" name="state" value="once" id="_anim_radio1_75902931552146ba862a7cd68ea69a31"
>
<label for="_anim_radio1_7d5593deebf6474e83cd4651148e30cf">Once</label>
<input type="radio" name="state" value="loop" id="_anim_radio2_7d5593deebf6474e83cd4651148e30cf"
<label for="_anim_radio1_75902931552146ba862a7cd68ea69a31">Once</label>
<input type="radio" name="state" value="loop" id="_anim_radio2_75902931552146ba862a7cd68ea69a31"
checked>
<label for="_anim_radio2_7d5593deebf6474e83cd4651148e30cf">Loop</label>
<input type="radio" name="state" value="reflect" id="_anim_radio3_7d5593deebf6474e83cd4651148e30cf"
<label for="_anim_radio2_75902931552146ba862a7cd68ea69a31">Loop</label>
<input type="radio" name="state" value="reflect" id="_anim_radio3_75902931552146ba862a7cd68ea69a31"
>
<label for="_anim_radio3_7d5593deebf6474e83cd4651148e30cf">Reflect</label>
<label for="_anim_radio3_75902931552146ba862a7cd68ea69a31">Reflect</label>
</form>
</div>
</div>
Expand All @@ -649,9 +649,9 @@ of components, A vs C and B vs C:
/* Instantiate the Animation class. */
/* The IDs given should match those used in the template above. */
(function() {
var img_id = "_anim_img7d5593deebf6474e83cd4651148e30cf";
var slider_id = "_anim_slider7d5593deebf6474e83cd4651148e30cf";
var loop_select_id = "_anim_loop_select7d5593deebf6474e83cd4651148e30cf";
var img_id = "_anim_img75902931552146ba862a7cd68ea69a31";
var slider_id = "_anim_slider75902931552146ba862a7cd68ea69a31";
var loop_select_id = "_anim_loop_select75902931552146ba862a7cd68ea69a31";
var frames = new Array(20);

frames[0] = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAiQAAAMgCAYAAAATFXnSAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90\
Expand Down Expand Up @@ -16461,7 +16461,7 @@ of components, A vs C and B vs C:
/* set a timeout to make sure all the above elements are created before
the object is initialized. */
setTimeout(function() {
anim7d5593deebf6474e83cd4651148e30cf = new Animation(frames, img_id, slider_id, 100.0,
anim75902931552146ba862a7cd68ea69a31 = new Animation(frames, img_id, slider_id, 100.0,
loop_select_id);
}, 0);
})()
Expand All @@ -16480,7 +16480,7 @@ mypy: disable-error-code="arg-type"

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

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


.. _sphx_glr_download_tutorials_phasorpy_components.py:
Expand Down
2 changes: 1 addition & 1 deletion main/_sources/tutorials/phasorpy_cursors.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ sphinx_gallery_thumbnail_number = 1

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

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


.. _sphx_glr_download_tutorials_phasorpy_cursors.py:
Expand Down
31 changes: 14 additions & 17 deletions main/_sources/tutorials/phasorpy_introduction.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -318,17 +318,14 @@ Filter phasor coordinates
Applying median filter to the calibrated phasor coordinates,
often multiple times, improves contrast:

.. GENERATED FROM PYTHON SOURCE LINES 162-170
.. GENERATED FROM PYTHON SOURCE LINES 162-167
.. code-block:: Python
# TODO: replace this with a ``phasor_filter`` function?
from skimage.filters import median
from phasorpy.phasor import phasor_filter
for _ in range(2):
real = median(real)
imag = median(imag)
real, imag = phasor_filter(real, imag, method='median', size=3, repeat=2)
Expand All @@ -337,12 +334,12 @@ often multiple times, improves contrast:
.. GENERATED FROM PYTHON SOURCE LINES 171-173
.. GENERATED FROM PYTHON SOURCE LINES 168-170
Pixels with low intensities are commonly excluded from analysis and
visualization of phasor coordinates:

.. GENERATED FROM PYTHON SOURCE LINES 173-179
.. GENERATED FROM PYTHON SOURCE LINES 170-176
.. code-block:: Python
Expand All @@ -359,7 +356,7 @@ visualization of phasor coordinates:
.. GENERATED FROM PYTHON SOURCE LINES 180-188
.. GENERATED FROM PYTHON SOURCE LINES 177-185
Plot phasor coordinates
-----------------------
Expand All @@ -370,7 +367,7 @@ plotting phasor and polar coordinates.
Large number of phasor coordinates, such as obtained from imaging,
are commonly visualized as 2D histograms:

.. GENERATED FROM PYTHON SOURCE LINES 188-197
.. GENERATED FROM PYTHON SOURCE LINES 185-194
.. code-block:: Python
Expand All @@ -395,11 +392,11 @@ are commonly visualized as 2D histograms:



.. GENERATED FROM PYTHON SOURCE LINES 198-199
.. GENERATED FROM PYTHON SOURCE LINES 195-196
For comparison, the uncalibrated, unfiltered phasor coordinates:

.. GENERATED FROM PYTHON SOURCE LINES 199-205
.. GENERATED FROM PYTHON SOURCE LINES 196-202
.. code-block:: Python
Expand All @@ -421,19 +418,19 @@ For comparison, the uncalibrated, unfiltered phasor coordinates:



.. GENERATED FROM PYTHON SOURCE LINES 206-208
.. GENERATED FROM PYTHON SOURCE LINES 203-205
To be continued
---------------

.. GENERATED FROM PYTHON SOURCE LINES 210-214
.. GENERATED FROM PYTHON SOURCE LINES 207-211
Appendix
--------

Print information about Python interpreter and installed packages:

.. GENERATED FROM PYTHON SOURCE LINES 214-217
.. GENERATED FROM PYTHON SOURCE LINES 211-214
.. code-block:: Python
Expand Down Expand Up @@ -468,14 +465,14 @@ Print information about Python interpreter and installed packages:
.. GENERATED FROM PYTHON SOURCE LINES 218-219
.. GENERATED FROM PYTHON SOURCE LINES 215-216
sphinx_gallery_thumbnail_number = 3


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

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


.. _sphx_glr_download_tutorials_phasorpy_introduction.py:
Expand Down
2 changes: 1 addition & 1 deletion main/_sources/tutorials/phasorpy_pca.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ sphinx_gallery_thumbnail_number = -2

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

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


.. _sphx_glr_download_tutorials_phasorpy_pca.py:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ sphinx_gallery_thumbnail_number = -2

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

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


.. _sphx_glr_download_tutorials_phasorpy_phasor_from_lifetime.py:
Expand Down
2 changes: 1 addition & 1 deletion main/_sources/tutorials/phasorpy_phasorplot.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ sphinx_gallery_thumbnail_number = 10

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

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


.. _sphx_glr_download_tutorials_phasorpy_phasorplot.py:
Expand Down
Loading

0 comments on commit e44dae8

Please sign in to comment.