GithubHelp home page GithubHelp logo

biehrer / ecg-analyzer Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 2.0 1.39 MB

Hardware accelerated realtime visualization of ecg signals in sweep charts via OpenGL (+algorithmic analyzation in the future)

Home Page: https://github.com/Biehrer/ecg-analyzer

License: Apache License 2.0

CMake 4.45% C++ 94.72% GLSL 0.55% HTML 0.28%
visualization ecg-analyzer ecg-signals pan-tomkins-qrs-detection pan-tompkins realtime-chart sweep-charts opengl wfdb physionet

ecg-analyzer's People

Contributors

biehrer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ecg-analyzer's Issues

Serial Port Reader

  • reading+ parsing
  • Don't break platform independence (e. g. no WinAPI) => Try Qt or Boost(-> Prefer Qt to not introduce another dependency)=> If not fast enough, use compiler pragmas to write platform independent code for each platform(linux api, win api, mac api,..)
  • support different file formats (make format specificable through some document)

Setup plots through text document, to store/load settings on application startup/shutdown

Setup plots(Create a InitializePlotsFromText(..) method inside jones_plot_app.cpp) through a external document:

Read and parse a text file, in which the specifications for the plots are

  • Make it possible to store the current plot configuration in such a file
  • Make it possible to load settings from this file inside a method:
    InitializePlotsFromText(const std::string& plot_settings_file)

Example format, which I think can be serialized easily(should be discussed) :

// Begin
[PLOT_SETTINGS] // the identifier of a plot settings page
NUM_OF_PLOTS = 2
….
[PLOT0]

[POSITION]
TOP_LEFT_X = 10
TOP_LEFT_Y = 20
WIDTH = 400
HEIGHT = 200
[AXES]
MIN_Y = -10
MAX_Y = 10
[PLOT1]
...
[POSITION]
TOP_LEFT_X = ..
TOP_LEFT_Y =..

[AXES]
MIN_Y=…

// End

  • write a class, which can serialize/deserialize(write/read) from or to such a text file:

Serializer::Write(const std::string plot_num,
const std::string category,
const std::string property,
QVariant value);

// example usage:
// write:
Serializer.Open("filepath")
Serializer.Write('0', 'POSITION', 'TOP_LEFT_X', 10)
Serializer.Write('1', 'AXES', 'TOP_LEFT_X', 10)
Serializer.Close();
// read:
auto top_left_x_mm = Serializer.Read('1', 'POSITION', 'TOP_LEFT_X')

Fast Line Drawing Mode

  • Implement a fast line drawing mode: This mode should reduce the number of lines drawn without affecting the chart appearance.

Problem:
The plot area width is usually a few to 1920 pixels.
For a sweep chart, which flows from the left to the right screen border, if there are a lot more data points (eg. 10k data points, when using a timerange of 10 seconds and a signal with a frequency of 1 kHz) than the plot area pixel width, many of the points are drawn at the same x-pixel coordinate.

What is visible at each x-pixel position is a vertical line, which connects the minimum point and the maximum point at the x-pixel-position.

TODO:
Implement fast line drawing mode, which automatically detects that there are too many points at the same x-pixel coordinate, and draws only a line segment joining the extreme points(min and max) at that coordinate. The resulting line should be visually indistinguishable from a line in which the line segments join all data points.

Show a waiting spinner, when loading a signal

To indicate that the application is loading a big file from disk(and can't do anything other in the meantime), show a spinner widget on the screen

=>How-to:

  1. Load a gif or Qt "movie":

Pseudocode:
QLabel *lbl = new QLabel;
QMovie *movie = new QMovie("G:/loader.gif");
lbl->setMovie(movie);
lbl->show();
movie->start();

Limitation: not resizeable

  1. Use widgets which are free on github like:

https://github.com/snowwlex/QtWaitingSpinner
or
https://github.com/mojocorp/QProgressIndicator

Untabify

untabify the project ( 4 spaces!!)

Draw time series as triangles

..instead of GL_LINE_STRIP and research the performance difference

"glDrawArrays(GL_TRIANGLES,...,..) /glDrawElements(GL_TRIANGLES,...,..) "

  • Also measure performance after improved batching of geometries

Implement Strip Chart

Implement a new chart type:

Strip Chart: implement a chart type with a scrolling display. This chart should plot values from left to right. If the screen is filled, new points are drawn at the rightmost point and old values are shifted to the left. Opposed to sweep-charts, in strip-charts, the line series never 'wraps' back from the right to the left screen border.

  • should inherit from Base_Chart or XY_Chart, when refactoring issue # 17(Abstration layer) is finished

Chart Abstraction Layer

Consider a different abstraction layer for future charts:

Sweep_Chart : extends XY_Chart
-ogl_sweep_chart_buffer

  • ...

XY_Chart : extends Base_Chart

  • min / max y-value
  • timerange_ms (min/max x-value)
  • major/minor tick values (x-/y-value)
  • ...

Base_Chart

  • Label information
  • Plot area
  • Plot geometry
  • ConvertToImage()
  • ConvertToFile()
  • ...

=> This makes it easier to implement other chart types as "Pie charts", "Histograms" => they only need to inherit from Base_Chart

Axes autoscaling

implement auto-scaling for y axes

-but first refactor the axes in its own class

Multichart-View

Possibilities:

  1. Implement a 'OGLMultiSweepChartBuffer_C', in which multiple time series are stored (and drawn) in one single vertex buffer object
    -Draw only one x axis for all plots and no y axis. Instead the time series comes out of the ‚label‘ (e.g. II / avR) from the left screen border.
    -There should be a ‚scale’ indicator, which tells the user, which length(on screen) maps to which millivolt. As alternative, just draw a surface grid, using 'Schreibgeschwindigkeit' and the physical dimensions of the screen

  2. Research..

Improve OpenGL uniform binding

Problem: Right now, uniforms are always updated, when anything is drawn. This is not necessary and uniform-binding and -setting is quite expensive.

Uniforms should only be updated, when a value(e.g. color of axes, color of surface, color of time series) is changed

Improve text rendering performance

  • don't use a shader only for text rendering-> use a 2 in 1 shader, in which a white texture is bound instead of the character texture, when it's needed to draw flat colors instead of text
  • implement a texture atlas

Implement lock free thread safe buffers

Instead of the RingBuffer_C classes, use a lock free atomic queue/stack for input buffering and measure perfomance with 'Timer_C' .

Test:

  • https://github.com/max0x7ba/atomic_queue

  • MoodyCamels SingleProducerSingleConsumer lock free queue

  • folly (facebook lib) queue

  • Boost Lock free queue

  • Qt?

  • Create own simple lock free Datastructure with a proper C++ Book

  • If possible, use header only libraries

Implement GetMicroseconds method in Timestamp_TP

Implement getter function of Timestamp_TP and use this new function inside the operator < overload of Chartpoint_TP, so the comparison is of a Timestamp_TP with a Chartpoint_TP is done in microseconds

Heart Rate Monitor

  • Implement a heart rate monitor (ogl_text_label), which displays the heart rate of a selected signal channel when enabled
  • implement small gui menu to select the channel which is used to to extract the heart rate
  • use Pan Topkins QRS detection algorithm to do this (signal_proc_lib)

Scrollable chart

alternative to sweep-chart

The axes/viewport should change/move over time-> adjustable viewport(in milliseconds)

Improve RemoveOutdatedDataInsideVBO()

improve performance by always removing a fixed size(e.g 5% of the total buffer) inside the OGLSweepChartBuffer's OnChartUpdate()-Method

=> Then it's not necessary to remove data each time a new datapoint is added -> this should be a performance improvement, because we don't have to search for indexes (binary search) each time a new value is added

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.