Author: Dakota Williams, firstname.lastname@example.org
##Table of Contents
- Filtering 1. Detrending 2. Denoising
- Marking Bad Leads
- Exporting 1. Data 2. Bad Leads 3. Annotations
##1. Setup [top]
###1.1. Prerequisites [top]
To run this application, a Java Runtime Environment (JRE) version 1.6 or higher is required.
This program is platform-independent thanks to the Java Virtual Machine, meaning this application is not dependent on the client operating system.
If plugin development is desired, then a Java Development Kit (JDK) version 1.6 or higher is also needed.
For more information about plugins, see section 2.1 of this document.
If compilation of the source code is necessary, then a JDK version 1.6 or higher and GNU
make is also needed.
If compilation is not necessary, skip section 1.2.
A breakdown of requirements and dependencies are shown in the table below.
| General Use | Plugin Development | Application Development
The latest JDK and JRE are available here.
- Windows - Either MinGW (just alias
make) or Cygwin and make sure that
- OS X - Install Xcode, specifically its developer tools.
- Linux - Lucky you! You have it already!
###1.2. Compilation [top]
Compiling the source code is as simple as running
This creates a folder called
ECGViewer in the source directory containing the jar and folders contains the libraries and plugins.
During active development there are other targets for the makefile:
- No target or
default: Just running
makewill compile all the source files into class files in the current directory.
run: This will run the compiled files with the classpath set to include necessary libraries.
debug: This will start
jdbwith the necessary classpath.
clean: This will delete the compiled class files from the source directory (note: not the plugin directory).
realclean: Does the same thing as
cleanas well as removing the
###1.3. Running [top]
To run the program, either double click on
ECGViewer/ECGViewer.jar to execute it, or, from command line, run the command
java -jar ECGViewer/ECGViewer.jar.
##2. Workflow [top] This section goes through a sample workflow of processing a dataset. To begin, run the program with one of the prescribed methods in section 1.3. The program should look like this:
###2.1. Opening [top]
There are two options for opening a file, opening the whole file and opening a subset of a file.
To open a whole file, go to
File->Open... which will present a dialog like this:
like this. The two text boxes on the left side of the dialog specify the time into the dataset that begins the subset and how long the subset is, respectively. Both of these times are measured in milliseconds.
Currently, the supported file types include .dat, .123, 64-lead .txt, and .csv (exported from this application) files.
For a more in depth analysis of these files, see
More file types can be read in by creating plugins.
For more information on creating plugins, see
###2.2. Filtering [top]
Applying a filter can be done two ways: To an individual lead, or to all the leads at once.
Applying a filter to all the leads in done in the main window from the
Filter All menu.
Selecting a method from there will display a preview dialog of a single lead and parameter sliders for that filter.
After clicking OK, the filter will be applied to all leads.
Controls for navigating the graph:
- Click-n-drag (upper-left to lower-right): Zoom in on area
- Click-n-drag (lower-right to upper-left): Zoom out
- Ctrl + click-n-drag: Pan
The lower text boxes allow for manual focus of the graph.
Start offset sets the where the left side of the graph is aligned.
Length sets how much the x-axis contains.
Filter on this lead window has all of the filter options available to filter just this lead.
####2.2.1. Detrending [top]
The main purpose of detrending is to bring the data to a baseline so it can accurately represent the data.
The detrending options can be found on the first half of the
Filter menu, before the separator.
- Detrend: A polynomial fit, the order of the polynomial is asked for in the dialog.
- Constant Offset: Shifts the entire signal by a constant value.
####2.2.2. Denoising [top]
Denoising a signal removes extraneous data and leaves the more important parts of the signal.
The denoising options are found on the second half of the
Filter menu, after the separator.
Some solid options include:
- Savitsky-Golay filter: Does a good job at smoothing the signal, however the morphology may change.
- FFT: Has a sweet spot for minimizing noise, however if too low, the filter may lose information.
- Wavelet: Solid all-around choice.
- Butterworth: Finicky, but works well.
###2.3. Marking Bad Leads [top]
Picking out bad leads must be done individually to each lead.
To do so, click on the lead's graph in the main window to open that lead's window.
On that lead's menu, click
Doing so will set the background of that lead to red, indicating it is bad.
There is an option to interpolate bad leads with their direct neighbors.
In the settings panel (Main Window
Interpolate Bad Leads? to activate this functionality.
###2.4. Annotations [top] Annotations are used to mark places of interest in the signal. Four designated titles currently exist:
They represent the major features in a single beat. Annotations are placed on an individual lead, but apply to all leads. For example, if an annotation is set on lead a, then on lead b, the same annotations appear.
Placing an annotation is a two-step procedure.
First, make sure
Annotation->Place Annotations is checked.
This disables the graph navigation function and enables placing annotations.
Second, selecting the correct type of annotation from the
Annotation menu and clicking on the graph where the annotation should be placed will add a new annotation.
To enable graph navigation, uncheck
There is a feature to auto annotate the R-waves (highest peaks) in the signal.
To use this, click
To clear all annotations, use
Customizing annotation colors can be set from the settings panel.
###2.5. Exporting [top]
Exporting data allows it to be used in other programs and routines not a part of this application.
All export methods can be found in the
File menu of the main window.
####2.5.1. Data [top]
Like opening data, exporting data can be done two ways: All at once, or just a subset.
To export all of the data, use
To export just a subset of the data, use
The subset bounds are defined by the two text boxes at the bottom of the main window.
In both of these methods, the file format must be chosen from the drop-down in the export dialog.
Currently, there is one way of exporting data. The data is exported into a file of comma separated values (CSV), where first row is the lead number, and each subsequent row is the time followed by the value for that lead at that time. Even though the drop-down provides a MATLAB matrix option, do not use it since it does not work.
####2.5.2. Bad Leads [top]
Exporting bad leads is done by
File->Export Bad Leads....
The file output is all of the lead numbers of the bad leads, one per line.
####2.5.3. Annotations [top]
Exporting annotations is invoked by
Each annotation is associated with a number in order of how they appear in the menu (P-wave -> 0, QRS -> 1, etc.).
These numbers are stored with there temporal position in the signal, one per line.
For example, an R-wave (3rd in menu -> 2) annotation was placed at time 1000.
When the annotations are exported, then the file would have a line that looks like
##3. Acknowledgements [top] This work is supported by the National Science Foundation CAREER Award #ACI-1350374
- JFreeChart v1.0.19 - unmodified
- Apache Commons Math v3.3 - unmodified
- savitzky-golay-filter - modified
- SGFilter.java was updated to resolve deprecated dependencies on Apache Commons Math. A copy of the Apache license is contained in the
- JWave - unmodified
- Java Look and Feel Graphics Repository - unmodified