Skip to content

Commit

Permalink
fix doc
Browse files Browse the repository at this point in the history
  • Loading branch information
SheinaG committed May 17, 2023
1 parent d382b4c commit b912f14
Show file tree
Hide file tree
Showing 32 changed files with 545 additions and 54 deletions.
4 changes: 2 additions & 2 deletions docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ Few steps are required to extract the morphological ECG biomarkers, those steps

3. Engineering of ECG Biomarkers - Using the fiducial points ECG biomarkers are engineered for individual ECG cycles. When a biomarker cannot be engineered because some fiducial points could not be detected by wavedet, then the feature was marked as a NaN. For an ECG channel, a total of 14 features are extracted from intervals duration and 8 from waves characteristics to describe the ECG morphology.

4. Summary Statistics - For a specified time window the six summary statistics (mean, median, min, max, IQR and std) are computed for all ECG biomarkers.

.. image:: ../ecg_wth_bio.png
:width: 600


4. Summary Statistics - For a specified time window the six summary statistics (mean, median, min, max, IQR and std) are computed for all ECG biomarkers.

Installation
-----------------------

Expand Down
Binary file modified docs/build/.doctrees/README.doctree
Binary file not shown.
Binary file modified docs/build/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/.doctrees/index.doctree
Binary file not shown.
Binary file modified docs/build/.doctrees/pecg.doctree
Binary file not shown.
Binary file modified docs/build/.doctrees/pecg.ecg.doctree
Binary file not shown.
Binary file not shown.
8 changes: 5 additions & 3 deletions docs/build/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@
<p class="caption" role="heading"><span class="caption-text">PECG API REFERENCE:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="pecg.html">pecg package</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">tutorials:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="tutorials/pecg_analysis.html">ECG morphological analysis</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorials/pecg_Holter_analysis.html">ECG morphological analysis</a></li>
</ul>


Expand Down Expand Up @@ -177,11 +181,9 @@ <h2>Description<a class="headerlink" href="#description" title="Permalink to thi
<li><p>ECG Signal Preprocessing - Before computing the ECG morphological biomarkers, prefiltering of the raw ECG time series is performed to remove the baseline wander and the high frequency noise. Specifically, the toolbox includes a zero phase second-order infinite impulse response bandpass filter with the passband of 0.67Hz - 100Hz. Also, the toolbox includes an optional Notch filter that can be set to 50 or 60Hz to remove the power-line interference.</p></li>
<li><p>ECG Fiducial Points Detection - The toolbox includes the epltd R-peaks algorithm, and the well-known wavedet algorithm for ECG fiducial points detection.</p></li>
<li><p>Engineering of ECG Biomarkers - Using the fiducial points ECG biomarkers are engineered for individual ECG cycles. When a biomarker cannot be engineered because some fiducial points could not be detected by wavedet, then the feature was marked as a NaN. For an ECG channel, a total of 14 features are extracted from intervals duration and 8 from waves characteristics to describe the ECG morphology.</p></li>
</ol>
<a class="reference internal image-reference" href="_images/ecg_wth_bio.png"><img alt="_images/ecg_wth_bio.png" src="_images/ecg_wth_bio.png" style="width: 600px;" /></a>
<ol class="arabic simple" start="4">
<li><p>Summary Statistics - For a specified time window the six summary statistics (mean, median, min, max, IQR and std) are computed for all ECG biomarkers.</p></li>
</ol>
<a class="reference internal image-reference" href="_images/ecg_wth_bio.png"><img alt="_images/ecg_wth_bio.png" src="_images/ecg_wth_bio.png" style="width: 600px;" /></a>
</div>
<div class="section" id="installation">
<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this heading"></a></h2>
Expand Down
4 changes: 4 additions & 0 deletions docs/build/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@
<p class="caption" role="heading"><span class="caption-text">PECG API REFERENCE:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../pecg.html">pecg package</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">tutorials:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorials/pecg_analysis.html">ECG morphological analysis</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorials/pecg_Holter_analysis.html">ECG morphological analysis</a></li>
</ul>


Expand Down
8 changes: 5 additions & 3 deletions docs/build/_modules/pecg/Example.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@
<p class="caption" role="heading"><span class="caption-text">PECG API REFERENCE:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../pecg.html">pecg package</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">tutorials:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../tutorials/pecg_analysis.html">ECG morphological analysis</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../tutorials/pecg_Holter_analysis.html">ECG morphological analysis</a></li>
</ul>


Expand Down Expand Up @@ -191,13 +195,11 @@ <h1>Source code for pecg.Example</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="n">ecg_type</span> <span class="o">==</span> <span class="s1">&#39;single-lead&#39;</span><span class="p">:</span>
<span class="n">signal</span><span class="p">,</span> <span class="n">fields</span> <span class="o">=</span> <span class="n">wfdb</span><span class="o">.</span><span class="n">rdsamp</span><span class="p">(</span><span class="s1">&#39;a01&#39;</span><span class="p">,</span> <span class="n">pn_dir</span><span class="o">=</span><span class="s1">&#39;apnea-ecg&#39;</span><span class="p">)</span>

<span class="n">signal</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">transpose</span><span class="p">(</span><span class="n">signal</span><span class="p">)</span>
<span class="c1">#signal = np.transpose(signal)</span>

<span class="k">return</span> <span class="n">signal</span><span class="p">,</span> <span class="n">fields</span><span class="p">[</span><span class="s1">&#39;fs&#39;</span><span class="p">]</span></div>



<span class="n">a</span> <span class="o">=</span> <span class="mi">5</span>
</pre></div>

</div>
Expand Down
15 changes: 11 additions & 4 deletions docs/build/_modules/pecg/Preprocessing.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../pecg.html">pecg package</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">tutorials:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../tutorials/pecg_analysis.html">ECG morphological analysis</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../tutorials/pecg_Holter_analysis.html">ECG morphological analysis</a></li>
</ul>



Expand Down Expand Up @@ -181,7 +186,10 @@ <h1>Source code for pecg.Preprocessing</h1><div class="highlight"><pre>
<span class="sd"> .. code-block:: python</span>

<span class="sd"> import pecg</span>
<span class="sd"> from pecg.Example import load_example</span>
<span class="sd"> from pecg import Preprocessing as Pre</span>
<span class="sd"> </span>
<span class="sd"> signal, fs = load_example(ecg_type=&#39;single-lead&#39;)</span>
<span class="sd"> pre = Pre.Preprocessing(signal, fs)</span>

<span class="sd"> &quot;&quot;&quot;</span>
Expand Down Expand Up @@ -239,7 +247,7 @@ <h1>Source code for pecg.Preprocessing</h1><div class="highlight"><pre>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">signal</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">signal</span>
<span class="n">fs</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fs</span>
<span class="n">filter_order</span> <span class="o">=</span> <span class="mi">75</span> <span class="c1"># ??</span>
<span class="n">filter_order</span> <span class="o">=</span> <span class="mi">75</span>
<span class="n">low_cut</span> <span class="o">=</span> <span class="mf">0.67</span>
<span class="n">high_cut</span> <span class="o">=</span> <span class="mi">100</span>

Expand Down Expand Up @@ -284,14 +292,13 @@ <h1>Source code for pecg.Preprocessing</h1><div class="highlight"><pre>
<span class="sd"> :return: The &#39;bsqi&#39; score, a flout between 0 and 1.</span>



<span class="sd"> .. code-block:: python</span>

<span class="sd"> bsqi_score = pre.bsqi()</span>
<span class="sd"> if bsqi_score &lt; 0.8:</span>
<span class="sd"> print(&#39;It&#39;s a bad quality ECG recording!&#39;)</span>

<span class="sd"> &quot;&quot;&quot;</span>

<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">fs</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fs</span>
<span class="n">signal</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">signal</span>

Expand Down
15 changes: 12 additions & 3 deletions docs/build/_modules/pecg/ecg/Biomarkers.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,15 @@



<p class="caption" role="heading"><span class="caption-text">POBM API REFERENCE:</span></p>
<p class="caption" role="heading"><span class="caption-text">PECG API REFERENCE:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../pecg.html">pecg package</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">tutorials:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../tutorials/pecg_analysis.html">ECG morphological analysis</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../tutorials/pecg_Holter_analysis.html">ECG morphological analysis</a></li>
</ul>



Expand Down Expand Up @@ -177,9 +182,13 @@ <h1>Source code for pecg.ecg.Biomarkers</h1><div class="highlight"><pre>


<span class="sd"> .. code-block:: python</span>

<span class="sd"> </span>
<span class="sd"> import pecg </span>
<span class="sd"> from pecg.ecg import Biomarkers as Obm</span>
<span class="sd"> obm = Obm.Biomarkers(f_ecg_rec, fs, fiducials)</span>
<span class="sd"> from pecg.Example import load_example</span>
<span class="sd"> </span>
<span class="sd"> signal, fs = load_example(ecg_type=&#39;12-lead&#39;)</span>
<span class="sd"> obm = Obm.Biomarkers(signal, fs, fiducials)</span>
<span class="sd"> ints, stat_i = obm.intervals()</span>
<span class="sd"> waves, stat_w = obm.waves()</span>

Expand Down
19 changes: 13 additions & 6 deletions docs/build/_modules/pecg/ecg/FiducialPoints.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,15 @@



<p class="caption" role="heading"><span class="caption-text">POBM API REFERENCE:</span></p>
<p class="caption" role="heading"><span class="caption-text">PECG API REFERENCE:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../pecg.html">pecg package</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">tutorials:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../tutorials/pecg_analysis.html">ECG morphological analysis</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../tutorials/pecg_Holter_analysis.html">ECG morphological analysis</a></li>
</ul>



Expand Down Expand Up @@ -183,9 +188,13 @@ <h1>Source code for pecg.ecg.FiducialPoints</h1><div class="highlight"><pre>
<span class="sd"> :param fs: The sampling frequency of the signal.[Hz]</span>

<span class="sd"> .. code-block:: python</span>

<span class="sd"> </span>
<span class="sd"> import pecg</span>
<span class="sd"> from pecg.Example import load_example</span>
<span class="sd"> from pecg.ecg import FiducialPoints as Fp</span>
<span class="sd"> fp = Fp.FiducialPoints(f_ecg_rec, fs)</span>
<span class="sd"> </span>
<span class="sd"> signal, fs = load_example(ecg_type=&#39;Holter&#39;)</span>
<span class="sd"> fp = Fp.FiducialPoints(signal, fs)</span>

<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">fs</span> <span class="o">&lt;=</span> <span class="mi">0</span><span class="p">:</span>
Expand All @@ -203,9 +212,7 @@ <h1>Source code for pecg.ecg.FiducialPoints</h1><div class="highlight"><pre>
<span class="sd"> The algorithm is described in the following paper: [1]_. The function is calculating</span>
<span class="sd"> the fiducial points of the ECG recording using wavelet transform.</span>

<span class="sd"> .. [1] Martinze at el (2004),</span>
<span class="sd"> A wavelet-based ECG delineator: evaluation on standard databases.</span>
<span class="sd"> IEEE Transactions on Biomedical Engineering, 51(4), 570-581.</span>
<span class="sd"> .. [1] Martínez, Juan Pablo, Rute Almeida, Salvador Olmos, Ana Paula Rocha, and Pablo Laguna. &quot;A wavelet-based ECG delineator: evaluation on standard databases.&quot; IEEE Transactions on biomedical engineering 51, no. 4 (2004): 570-581.</span>

<span class="sd"> :param matlab_pat: path to matlab runtime 2021a directory</span>
<span class="sd"> :param peaks: Optional input- Annotation of the reference peak detector (Indices of the peaks), as an ndarray of shape (L,N), when L is the number of channels or leads and N is the number of peaks. If peaks are not given, the peaks are calculated with the jqrs detector.</span>
Expand Down
4 changes: 2 additions & 2 deletions docs/build/_sources/README.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ Few steps are required to extract the morphological ECG biomarkers, those steps

3. Engineering of ECG Biomarkers - Using the fiducial points ECG biomarkers are engineered for individual ECG cycles. When a biomarker cannot be engineered because some fiducial points could not be detected by wavedet, then the feature was marked as a NaN. For an ECG channel, a total of 14 features are extracted from intervals duration and 8 from waves characteristics to describe the ECG morphology.

4. Summary Statistics - For a specified time window the six summary statistics (mean, median, min, max, IQR and std) are computed for all ECG biomarkers.

.. image:: ../ecg_wth_bio.png
:width: 600


4. Summary Statistics - For a specified time window the six summary statistics (mean, median, min, max, IQR and std) are computed for all ECG biomarkers.

Installation
-----------------------

Expand Down
13 changes: 13 additions & 0 deletions docs/build/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,27 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
PECG API REFERENCE
==================

.. include:: README.rst

.. toctree::
:maxdepth: 4
:caption: PECG API REFERENCE:

pecg


TUTORIALS
==================

.. toctree::
:maxdepth: 4
:caption: tutorials:

tutorials/pecg_analysis.rst
tutorials/pecg_Holter_analysis.rst



Expand Down
53 changes: 53 additions & 0 deletions docs/build/_sources/tutorials/pecg_Holter_analysis.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
ECG morphological analysis
==========================

In this tutorial you will learn how to use **PhysioZoo ECG** to compute the morphological biomarkers and export the computed values.
(link: https://physiozoo.com/)

**Introduction**
----------------------
An electrocardiogram (ECG) is a simple test that uses temporary electrodes on the chest and limbs to monitor, track, and document the heart's electrical activity.
The ECG provides information about the function of the intracardiac conduction system, which is responsible for generating and propagating electrical impulses through the heart.
The ECG records the sequence of depolarization and repolarization of the atria and ventricles, which are represented by different waves on the ECG.

Studying the morphological statistics of the signal may provide information on the underlying physiological heart condition.
**PhysioZoo ECG** provides the framework and tools for extracting morphological biomarkers from the ECG signal.

**Performing ECG morphological analysis**
------------------------------------------------------------
Start by entering the ECG interface by clicking on the 'Peak Detection' tab on the top right, then load some ECG example by clicking File -> Open data file -> ECG_example.txt. The program will automaticly present the
ECG file you uploded.

.. image:: before_analysis.png
:align: center

To perform your morphological analysis, please follow these instructions:

#. Prefiltering the signal: On the left panel, select the "Configuration" tab. On the bottom of the tab, you will find a section labeled: **Fiducials filtering parameters** which refers to two filters applied to your signal before analysis:

* The bandpass filter in the range of [0.67,100] Hz. Its purpose is to remove the baseline wander and high frequency noise. Check the box labeled *Bandpass filter* if you want to use it

* The notch filter. Its purpose is to remove the powerline interface. If you want to use it, choose the frequency of the powerline interface of the country where the ECG was recorded.

#. Definition of the window for anlysis: On the right panel, define the W.S. (start of the window) and the W.L. (length of the window) you want to analyze. You can analyze all of your signal or part of it. Note that if you analyze a long window,it may take some time.

#. Visualization of multiple leads: Choose the leads you want to visualize and the leads on which you want to plot the fiducial points.

#. Click the **Find Fiducials** button.

Congrats! You have made your first morphological analysis with **PhysioZoo ECG**!
The biomarkers are divided into two different categories: Duration and Amplitudes, the statistical measurments of the biomarkers will be presented in a table, in the bottom panel.

.. image:: after_analysis.png
:align: center

.. note:: For multilead anlysis only the median of each biomarker will be presented in the table, while for singel lead anlysis 6 statistical mesurment will be presented for each biomarker:
mean, median, min, max. IQR and std.

**Exporting morphological biomarkers**
--------------------------------------------

You can export the morphological biomarkers by **PhysioZoo ECG**. Go to File -> Save Fiducial statistics. The excel file that you saved containe all the computed biomarkers for each lead.

.. image:: results_mor_analysis.PNG
:align: center
4 changes: 4 additions & 0 deletions docs/build/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@
<p class="caption" role="heading"><span class="caption-text">PECG API REFERENCE:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="pecg.html">pecg package</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">tutorials:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="tutorials/pecg_analysis.html">ECG morphological analysis</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorials/pecg_Holter_analysis.html">ECG morphological analysis</a></li>
</ul>


Expand Down

0 comments on commit b912f14

Please sign in to comment.