Skip to content

Commit

Permalink
2.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
erdogant committed Nov 19, 2023
1 parent 7649157 commit e1a32f8
Show file tree
Hide file tree
Showing 19 changed files with 26 additions and 25 deletions.
Binary file modified docs/pages/doctrees/Mask.doctree
Binary file not shown.
Binary file modified docs/pages/doctrees/Plots.doctree
Binary file not shown.
Binary file modified docs/pages/doctrees/Pre-processing.doctree
Binary file not shown.
Binary file modified docs/pages/doctrees/Topology.doctree
Binary file not shown.
Binary file modified docs/pages/doctrees/Use-cases.doctree
Binary file not shown.
Binary file modified docs/pages/doctrees/environment.pickle
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/pages/html/Mask.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ <h2>Two-dimensional data<a class="headerlink" href="#two-dimensional-data" title
The output variables <strong>Xdetect</strong> and <strong>Xranked</strong> has the same shape as the input data. The elements with value &gt; 0 depict a region of interest.</p>
<p>Plot the image with the detected peaks:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># Import library</span>
<span class="n">fp</span><span class="o">.</span><span class="n">plot</span><span class="p">()</span>
<span class="n">fp</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">figure_order</span><span class="o">=</span><span class="s1">&#39;horizontal&#39;</span><span class="p">)</span>
</pre></div>
</div>
<figure class="align-default" id="figure-6">
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/html/Plots.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ <h2>Pre-processing plot<a class="headerlink" href="#pre-processing-plot" title="
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># Import library</span>
<span class="kn">from</span> <span class="nn">findpeaks</span> <span class="kn">import</span> <span class="n">findpeaks</span>
<span class="c1"># Initialize</span>
<span class="n">fp</span> <span class="o">=</span> <span class="n">findpeaks</span><span class="p">(</span><span class="n">method</span><span class="o">=</span><span class="s1">&#39;topology&#39;</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">denoise</span><span class="o">=</span><span class="s1">&#39;fastnl&#39;</span><span class="p">,</span> <span class="n">window</span><span class="o">=</span><span class="mi">3</span><span class="p">,</span> <span class="n">togray</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">imsize</span><span class="o">=</span><span class="p">(</span><span class="mi">50</span><span class="p">,</span><span class="mi">150</span><span class="p">))</span>
<span class="n">fp</span> <span class="o">=</span> <span class="n">findpeaks</span><span class="p">(</span><span class="n">method</span><span class="o">=</span><span class="s1">&#39;topology&#39;</span><span class="p">,</span> <span class="n">whitelist</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;peak&#39;</span><span class="p">])</span>
<span class="c1"># Import example</span>
<span class="n">X</span> <span class="o">=</span> <span class="n">fp</span><span class="o">.</span><span class="n">import_example</span><span class="p">(</span><span class="s2">&quot;2dpeaks&quot;</span><span class="p">)</span>
<span class="c1"># Detect peaks</span>
Expand Down Expand Up @@ -240,7 +240,7 @@ <h2>Plot<a class="headerlink" href="#plot" title="Link to this heading"></a><
</dd>
</dl>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># Plot</span>
<span class="n">fp</span><span class="o">.</span><span class="n">plot</span><span class="p">()</span>
<span class="n">fp</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">figure_order</span><span class="o">=</span><span class="s1">&#39;horizontal&#39;</span><span class="p">)</span>
</pre></div>
</div>
<table class="docutils align-center" id="id4">
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/html/Pre-processing.html
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,13 @@ <h1>Preprocessing<a class="headerlink" href="#preprocessing" title="Link to this
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># Import library</span>
<span class="kn">from</span> <span class="nn">findpeaks</span> <span class="kn">import</span> <span class="n">findpeaks</span>
<span class="c1"># Init</span>
<span class="n">fp</span> <span class="o">=</span> <span class="n">findpeaks</span><span class="p">(</span><span class="n">method</span><span class="o">=</span><span class="s2">&quot;topology&quot;</span><span class="p">,</span> <span class="n">imsize</span><span class="o">=</span><span class="p">(</span><span class="mi">50</span><span class="p">,</span><span class="mi">100</span><span class="p">),</span> <span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">togray</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">denoise</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span>
<span class="n">fp</span> <span class="o">=</span> <span class="n">findpeaks</span><span class="p">(</span><span class="n">method</span><span class="o">=</span><span class="s2">&quot;topology&quot;</span><span class="p">,</span> <span class="n">whitelist</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;peak&#39;</span><span class="p">],</span> <span class="n">imsize</span><span class="o">=</span><span class="p">(</span><span class="mi">50</span><span class="p">,</span><span class="mi">100</span><span class="p">),</span> <span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">togray</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">denoise</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span>
<span class="c1"># Small dataset</span>
<span class="n">X</span> <span class="o">=</span> <span class="n">fp</span><span class="o">.</span><span class="n">import_example</span><span class="p">(</span><span class="s2">&quot;2dpeaks&quot;</span><span class="p">)</span>

<span class="c1"># Interpolate the data using linear by factor 10</span>
<span class="n">results</span> <span class="o">=</span> <span class="n">fp</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">X</span><span class="p">)</span>
<span class="n">fp</span><span class="o">.</span><span class="n">plot</span><span class="p">()</span>
<span class="n">fp</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">figure_order</span><span class="o">=</span><span class="s1">&#39;horizontal&#39;</span><span class="p">)</span>
<span class="c1"># fp.plot_persistence()</span>
</pre></div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/html/Topology.html
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ <h2>Two-dimensional<a class="headerlink" href="#two-dimensional" title="Link to
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># Import library</span>
<span class="kn">from</span> <span class="nn">findpeaks</span> <span class="kn">import</span> <span class="n">findpeaks</span>
<span class="c1"># Initialize</span>
<span class="n">fp</span> <span class="o">=</span> <span class="n">findpeaks</span><span class="p">(</span><span class="n">method</span><span class="o">=</span><span class="s1">&#39;topology&#39;</span><span class="p">)</span>
<span class="n">fp</span> <span class="o">=</span> <span class="n">findpeaks</span><span class="p">(</span><span class="n">method</span><span class="o">=</span><span class="s1">&#39;topology&#39;</span><span class="p">,</span> <span class="n">whitelist</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;peak&#39;</span><span class="p">])</span>
<span class="c1"># Example 2d image</span>
<span class="n">X</span> <span class="o">=</span> <span class="n">fp</span><span class="o">.</span><span class="n">import_example</span><span class="p">(</span><span class="s1">&#39;2dpeaks&#39;</span><span class="p">)</span>
<span class="c1"># Fit topology method on the 1d-vector</span>
Expand All @@ -394,7 +394,7 @@ <h2>Two-dimensional<a class="headerlink" href="#two-dimensional" title="Link to
The output variables <strong>Xdetect</strong> and <strong>Xranked</strong> is in the same shape as the input image and contains the detected peaks/valleys (high=best peak and low=best valley). The key <strong>persistence</strong> is a dataframe containing the x,y coordinates and more information about the peaks/valleys. See api-docstrings for more information.</p>
<p>Plot the image with the detected peaks:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># Import library</span>
<span class="n">fp</span><span class="o">.</span><span class="n">plot</span><span class="p">()</span>
<span class="n">fp</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">figure_order</span><span class="o">=</span><span class="s1">&#39;horizontal&#39;</span><span class="p">)</span>
</pre></div>
</div>
<figure class="align-default" id="figure-5">
Expand Down
8 changes: 4 additions & 4 deletions docs/pages/html/Use-cases.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ <h1>SAR<a class="headerlink" href="#sar" title="Link to this heading"></a></h
<span class="c1"># Fit</span>
<span class="n">fp</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">img</span><span class="p">)</span>
<span class="c1"># Thousands of peaks are detected at this point.</span>
<span class="n">fp</span><span class="o">.</span><span class="n">plot</span><span class="p">()</span>
<span class="n">fp</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">figure_order</span><span class="o">=</span><span class="s1">&#39;horizontal&#39;</span><span class="p">)</span>
<span class="n">fp</span><span class="o">.</span><span class="n">plot_mesh</span><span class="p">()</span>
</pre></div>
</div>
Expand All @@ -266,7 +266,7 @@ <h1>SAR<a class="headerlink" href="#sar" title="Link to this heading"></a></h
<span class="c1"># Import image example</span>
<span class="n">img</span> <span class="o">=</span> <span class="n">fp</span><span class="o">.</span><span class="n">import_example</span><span class="p">(</span><span class="s1">&#39;2dpeaks_image&#39;</span><span class="p">)</span>
<span class="c1"># Initializatie</span>
<span class="n">fp</span> <span class="o">=</span> <span class="n">findpeaks</span><span class="p">(</span><span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">denoise</span><span class="o">=</span><span class="s1">&#39;fastnl&#39;</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;window&#39;</span><span class="p">:</span> <span class="mi">31</span><span class="p">},</span> <span class="n">togray</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">imsize</span><span class="o">=</span><span class="p">(</span><span class="mi">300</span><span class="p">,</span><span class="mi">300</span><span class="p">))</span>
<span class="n">fp</span> <span class="o">=</span> <span class="n">findpeaks</span><span class="p">(</span><span class="n">method</span><span class="o">=</span><span class="s1">&#39;topology&#39;</span><span class="p">,</span> <span class="n">limit</span><span class="o">=</span><span class="mi">160</span><span class="p">,</span> <span class="n">scale</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">togray</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">imsize</span><span class="o">=</span><span class="p">(</span><span class="mi">150</span><span class="p">,</span> <span class="mi">150</span><span class="p">),</span> <span class="n">denoise</span><span class="o">=</span><span class="s1">&#39;lee_sigma&#39;</span><span class="p">,</span> <span class="n">params</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;window&#39;</span><span class="p">:</span> <span class="mi">17</span><span class="p">})</span>
<span class="c1"># Fit</span>
<span class="n">fp</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">img</span><span class="p">)</span>
</pre></div>
Expand All @@ -287,7 +287,7 @@ <h1>SAR<a class="headerlink" href="#sar" title="Link to this heading"></a></h
</table>
<p>In the next step, we can examine the detected peaks (see below). But these peaks are barely visible on the plot. Nevertheless, we seem to removed many peaks compared to the not-preprocessed image.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># Plot</span>
<span class="n">fp</span><span class="o">.</span><span class="n">plot</span><span class="p">()</span>
<span class="n">fp</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">figure_order</span><span class="o">=</span><span class="s1">&#39;horizontal&#39;</span><span class="p">)</span>
</pre></div>
</div>
<table class="docutils align-center" id="id4">
Expand Down Expand Up @@ -372,7 +372,7 @@ <h1>SAR<a class="headerlink" href="#sar" title="Link to this heading"></a></h
<section id="denoising">
<h2>Denoising<a class="headerlink" href="#denoising" title="Link to this heading"></a></h2>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">findpeaks</span> <span class="kn">import</span> <span class="n">findpeaks</span>
<span class="n">fp</span> <span class="o">=</span> <span class="n">findpeaks</span><span class="p">()</span>
<span class="n">fp</span> <span class="o">=</span> <span class="n">findpeaks</span><span class="p">(</span><span class="n">limit</span><span class="o">=</span><span class="mi">160</span><span class="p">)</span>
<span class="n">img</span> <span class="o">=</span> <span class="n">fp</span><span class="o">.</span><span class="n">import_example</span><span class="p">(</span><span class="s1">&#39;2dpeaks_image&#39;</span><span class="p">)</span>
<span class="kn">import</span> <span class="nn">findpeaks</span>

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/html/_sources/Mask.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Plot the image with the detected peaks:
.. code:: python
# Import library
fp.plot()
fp.plot(figure_order='horizontal')
.. _Figure_6:

Expand Down
4 changes: 2 additions & 2 deletions docs/pages/html/_sources/Plots.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Depending on the number of user defined pre-processing steps, the plot will add
# Import library
from findpeaks import findpeaks
# Initialize
fp = findpeaks(method='topology', scale=True, denoise='fastnl', window=3, togray=True, imsize=(50,150))
fp = findpeaks(method='topology', whitelist=['peak'])
# Import example
X = fp.import_example("2dpeaks")
# Detect peaks
Expand Down Expand Up @@ -95,7 +95,7 @@ The **plot** function :func:`findpeaks.findpeaks.findpeaks.plot` plots the 3 maj
.. code:: python
# Plot
fp.plot()
fp.plot(figure_order='horizontal')
.. |figP1| image:: ../figs/plot_example1.png
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/html/_sources/Pre-processing.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ Each of these steps can be controlled by setting the input parameters.
# Import library
from findpeaks import findpeaks
# Init
fp = findpeaks(method="topology", imsize=(50,100), scale=True, togray=True, denoise=None)
fp = findpeaks(method="topology", whitelist=['peak'], imsize=(50,100), scale=True, togray=True, denoise=None)
# Small dataset
X = fp.import_example("2dpeaks")
# Interpolate the data using linear by factor 10
results = fp.fit(X)
fp.plot()
fp.plot(figure_order='horizontal')
# fp.plot_persistence()
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/html/_sources/Topology.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ The docstring provide the information regarding the input/output parameters: :fu
# Import library
from findpeaks import findpeaks
# Initialize
fp = findpeaks(method='topology')
fp = findpeaks(method='topology', whitelist=['peak'])
# Example 2d image
X = fp.import_example('2dpeaks')
# Fit topology method on the 1d-vector
Expand All @@ -276,7 +276,7 @@ Plot the image with the detected peaks:
.. code:: python
# Import library
fp.plot()
fp.plot(figure_order='horizontal')
.. _Figure_5:

Expand Down
8 changes: 4 additions & 4 deletions docs/pages/html/_sources/Use-cases.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Let's load a SAR image, apply denoising techniques and then detect peaks.
# Fit
fp.fit(img)
# Thousands of peaks are detected at this point.
fp.plot()
fp.plot(figure_order='horizontal')
fp.plot_mesh()
Expand All @@ -134,7 +134,7 @@ From this point on, we will *pre-process* the image and apply the *topology* met
# Import image example
img = fp.import_example('2dpeaks_image')
# Initializatie
fp = findpeaks(scale=True, denoise='fastnl', params={'window': 31}, togray=True, imsize=(300,300))
fp = findpeaks(method='topology', limit=160, scale=True, togray=True, imsize=(150, 150), denoise='lee_sigma', params={'window': 17})
# Fit
fp.fit(img)
Expand Down Expand Up @@ -163,7 +163,7 @@ In the next step, we can examine the detected peaks (see below). But these peaks
.. code:: python
# Plot
fp.plot()
fp.plot(figure_order='horizontal')
.. |figU1| image:: ../figs/sonar_plot.png
Expand Down Expand Up @@ -267,7 +267,7 @@ Denoising
.. code:: python
from findpeaks import findpeaks
fp = findpeaks()
fp = findpeaks(limit=160)
img = fp.import_example('2dpeaks_image')
import findpeaks
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/html/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion findpeaks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

__author__ = 'Erdogan Tasksen'
__email__ = '[email protected]'
__version__ = '2.6.0'
__version__ = '2.6.1'

# module level doc-string
__doc__ = """
Expand Down
3 changes: 2 additions & 1 deletion findpeaks/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
imsize=(150, 150),
denoise='lee_sigma',
params={'window': 17},
limit=160,
)

# Import example image
Expand All @@ -102,7 +103,7 @@
# Create mesh plot
fp.plot_mesh()
# Create denoised plot
fp.plot(limit=160, figure_order='horizontal')
fp.plot(figure_order='horizontal')
fp.plot_persistence()

# %% Issue
Expand Down

0 comments on commit e1a32f8

Please sign in to comment.