Coder Social home page Coder Social logo

sigviewer's Introduction

SigViewer

SigViewer is a viewing application for biosignals such as EEG or MEG time series. In addition to viewing raw data, SigViewer can also create, edit, and display event information (such as annotations or artifact selections).

Download

Screenshots

screenshot-1

Building SigViewer

SigViewer requires a standard-compliant C++11 build toolchain, for example recent versions of GCC or Clang. Other compilers such as MSVC might work, but are not tested. Furthermore, SigViewer depends on Qt. Current SigViewer builds use Qt 5.12 (previous or future versions are not guaranteed to work).

SigViewer also depends on libbiosig and libxdf. There are two options to get these external dependencies for your platform:

  1. Build these dependencies yourself (see separate descriptions below).
  2. Use our pre-built binaries. The corresponding archive contains binary versions of libbiosig and libxdf and must be extracted into SigViewer’s source folder (which we denote as $sigviewer).

Windows

Building SigViewer on Windows is currently not supported. We provide binaries created with the MXE cross compilation environment.

macOS

SigViewer requires Mac OS X (now renamed to macOS) 10.9 or later. First, install XCode from the App Store. Next, download and install Qt 5.12.3 for macOS or install Qt via Homebrew by running brew install qt in a terminal. Make sure that qmake is available on the path if you want to build SigViewer in a terminal. Alternatively, you can build SigViewer with Qt Creator (please refer to the description for building SigViewer on Windows).

  1. Download and unzip the SigViewer source.
  2. Provide all external dependencies:
    • Either download the external archive and extract it inside $sigviewer.
    • Or copy the necessary files from libbiosig and libxdf builds to the corresponding folders as detailed in the build descriptions for libbiosig and libxdf below.
  3. In a terminal, change to $sigviewer and run qmake.
  4. Run make (or if you want to use more cores to build in parallel, run make -j4 if you want to use four cores). The SigViewer binary is built in the bin/release folder.
  5. To create a stand-alone version of SigViewer, open a terminal, change into $sigviewer/bin/release and run macdeployqt sigviewer.app -dmg. This creates a disk image with the app, which can then be dragged to the Applications folder.

Linux

Install the GNU build toolchain and Qt 5 with your native package manager. You can either build on the command line or with Qt Creator (which you then need to install).

  1. Download and unzip the SigViewer source.
  2. Provide all external dependencies:
    • Either download the external archive and extract it inside $sigviewer.
    • Or copy the necessary files from libbiosig and libxdf builds to the corresponding folders as detailed in the build descriptions for libbiosig and libxdf below.
  3. In a terminal, change to $sigviewer and run qmake.
  4. Run make (or if you want to use more cores to build in parallel, run make -j 4 if you want to use four cores). The SigViewer binary is built in the bin/release folder.

Building external dependencies

Windows

Building libbiosig on Windows is currently not supported.

To build libxdf from source, follow these steps:

  1. Download and unzip the libxdf source (SigViewer 0.6.4 uses libxdf 0.99).
  2. On the command line, run qmake followed by mingw32-make (or build the project with Qt Creator) (instead of qmake, you can also run cmake .).
  3. Copy xdf.h into $sigviewer/external/include and libxdf.a to $sigviewer/external/lib.

macOS

To build libbiosig from source, follow these steps:

  1. Download and unzip BioSig for C/C++ into $libbiosig (SigViewer 0.6.4 uses libbiosig 1.9.4).
  2. Change line 156 of Makefile.in to CFLAGS += -mmacosx-version-min=10.9 (replace 10.13 with 10.9).
  3. In a terminal, change to $libbiosig and run ./configure.
  4. Run make.
  5. Copy biosig.h, biosig-dev.h, gdftime.h, and physicalunits.h to $sigviewer/external/include and libbiosig.a to $sigviewer/external/lib.

To build libxdf from source, follow these steps:

  1. Download and unzip the libxdf source to $libxdf (SigViewer 0.6.4 uses libxdf 0.99).
  2. In a terminal, change to $libxdf and run qmake followed by make (instead of qmake, you can also run cmake .).
  3. Copy xdf.h into $sigviewer/external/include and libxdf.a to $sigviewer/external/lib.

Linux

To build libbiosig from source, follow these steps:

  1. Download and unzip BioSig for C/C++ into $libbiosig (SigViewer 0.6.4 uses libbiosig 1.9.4).
  2. In a terminal, change to $libbiosig and run ./configure.
  3. Run make.
  4. Copy biosig.h, biosig-dev.h, gdftime.h, and physicalunits.h to $sigviewer/external/include and libbiosig.a to $sigviewer/external/lib.

To build libxdf from source, follow these steps:

  1. Download and unzip the libxdf source to $libxdf (SigViewer 0.6.4 uses libxdf 0.99).
  2. In a terminal, change to $libxdf and run qmake followed by make (instead of qmake, you can also run cmake .).
  3. Copy xdf.h into $sigviewer/external/include and libxdf.a to $sigviewer/external/lib.

sigviewer's People

Contributors

cbrnr avatar darktemplarbasealt avatar freiform avatar ksmathers64 avatar schloegl avatar stfnrpplngr avatar yida-lin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sigviewer's Issues

Fix runtime warnings

The following runtime warnings should be fixed:

QIODevice::read (QFile, ":version.txt"): device not open
QMainWindow::saveState(): 'objectName' not set for QToolBar 0x17f63c0 'File'
QMainWindow::saveState(): 'objectName' not set for QToolBar 0x17e74e0 'Mode'
QMainWindow::saveState(): 'objectName' not set for QToolBar 0x15ccf80 'View'

Unsupported .hea file crashes when scrolling to the end

When viewing a large signal, zooming out, and scrolling to end of the signal, sigviewer crashes at signal_graphics_item.cpp line 238 because of accessing memory at address 0.

The values of the local variables at the time of crash are:

channel_overlapping false bool
clip 699.0x389.0+89394477.0+0.0 QRectF
data_block (null) QSharedPointer<sigviewer::DataBlock const>
last_x 89394466.5 double
last_y 0 sigviewer::float64
length 1418 unsigned int
new_y 6.9533484305045863e-310 sigviewer::float64
option @0xcf95a8 QStyleOptionGraphicsItem
painter @0x7fffffffca90 QPainter
pixel_per_sample 0.5 double
start_sample 178788933 unsigned int
this @0x10977b0 sigviewer::SignalGraphicsItem

The number of samples in the signal is 178790349.

I fixed it by adding the line:

if (data_block == NULL) return;

after line 234 ( ... data_block = ... )

Page-based autoscale feature

Autoscale should rescale graphs every time we use zoom in/out, time slider.
When viewing long records with many artefact range saturations this feature is essential.
sigviewer

Support Qt 5.3?

Currently, SigViewer requires Qt 5.8 because of one flag: Qt::ItemIsAutoTristate which we need in src/gui_impl/dialogs/channel_selection_dialog.cpp. If we replace this with the deprecated flag Qt::ItemIsTristate, SigViewer seems to build just fine with Qt 5.3. @Yida-Lin is there another option that doesn't entail using the deprecated flag? Maybe with a preprocessor switch?

The order of the streams in XDF file seems to be random

I know this is not a SigViewer problem but I thought it's easier to discuss it here.

Also currently the way libxdf loads the streams don't follow the exact stream number (well, when I was writing libxdf I basically modeled libxdf on the load_xdf function in MatLab, and that's the approach in the MatLab code).

Building on Ubuntu 16.04 failed without -std=gnu++11 compiler flag

making sigviewer on Ubuntu 16.04 amb64 with g++ 5.4.0 results in a segmentation error when running sigviewer. I had to add a line with "QMAKE_CXXFLAGS += -std=gnu++11" to sigviewer.pro to fix it. It seems that the for loop statement at line 40 in gui_action_command.cpp is not recognized by g++ without this flag. The compiler complains then

sigviewer/src/gui/gui_action_command.cpp:40: Warnung: range-based 'for' loops only available with -std=c++11 or -std=gnu++11
for (ActionConnector* con : connectors_)

Event Color no longer changable

I just realized that after attempting to change the event color and click OK, it has no effect. Maybe I did something wrong earlier in some commits. I will try to solve it.

Build libbiosig on Windows

Currently we can build libbiosig from source only on macOS and Linux. However, we should try to get it to work on Windows as well using our build environment. Right now, this means MinGW, this should be our priority here. Since SigViewer builds with VC without any problem, in theory it should be possible to compile libbiosig with VC as well. This would be the ideal solution, because VC is the default build environment on Windows, but I doubt that it will be easy to adapt the source of libbiosig (it uses a lot of GCC extensions).

Horizontal scrolling via scrollbar arrows

@Yida-Lin could you please check if horizontal scrolling works as expected? A colleague of mine is using SigViewer on Windows, and he told me that when he clicks on the arrow icons next to the horizontal scrollbar, the signal scrolls by only a tiny amount (possibly just one sample). In contrast, when you press the arrow key (left or right), the signal scrolls by a more sensible amount (e.g. 0.2 seconds). I can't test this because macOS doesn't have scrollbar arrows.

Scrolling via scrollbar icons or arrow keys should behave identically.

Two config files

SigViewer seems to create two config files, at least as tested here on my Mac. They are called:

com.sigviewer.plist
com.yourcompany.sigviewer.plist

This should be streamlines so that everything is contained in the former file.

NaN in signals should not be drawn

I attach how signal with NaN values looks in SigView and in Matlab. In Sigviewer at the begining and ending of NaN's series we see big fronts which look like artefacts.

untitled
untitled2

Export events to CSV

It would be nice to add an option that exports events to a CSV file (or any similar plain text format), because EVT files are not that straightforward to read.

Allow multiple SigViewer instances

It would be nice if multiple SigViewer instances could be open, completely independent of each other. This actually works right now, but the GUI needs to be adapted a bit. For example, when there is a file already open, and the user wants to open another file, a new SigViewer instance should be spawned. Not sure if we need to pop up a dialog window first or not.

Add export to CSV button in Events list toolbar

Right now there's only a delete button, which deletes the selected event(s) from the list. It would be convenient to have an export to CSV button there. This would also make this functionality more visible/accessible.

A loophole

@cbrnr Just noticed a loophole when debugging Stefan's file:

Before I thought string streams are always irregular streams, but turns out Stefan's file has a stream that is 5000Hz but is string only.

Could also be why that file doesn't load.

I am debugging more into this.

Sorry @stfnrpplngr it might take a while.

Optional tabs cannot be closed anymore

Recently, we removed the close buttons on the Signal Data and Events tabs because they cannot be closed. However, this change also got rid of the close buttons on the Mean and Power Spectrum tabs, which are only present if they are computed. Since these views depend on some parameters, and therefore provide a different view on specific aspects of the data, there should be a way to close these tabs. @Yida-Lin is it possible to only remove the close buttons for the first two (main) tabs?

Add option to filter signals

Some biosignals require filtering before they can be visualized, e.g. EEG recorded without any HP filter typically has huge drifts. The auto-centering function, which centers each channel around its mean, doesn't work in many cases where the variance of the drift is large compared to its mean.

There should be at least two filter types, namely high-pass and low-pass filters. Band-pass and band-stop can be constructed by combining these two types.

We need to think about how we integrate filtering into SigViewer. Do we treat it like auto-centering (that is, something that can be toggled on and off)? Or do we open a new tab? How can multiple filters be applied sequentially? Which parameters does the user set before filtering?

Create auto-center toggle button

The current implementation of our auto-center feature is not very intuitive. I suggest that we replace the two buttons "Zero Line Centered"/"Zero Line Fitted" with one toggle button. If this button is not pressed, "Zero Line Centered" should be selected. If this button is pressed, "Zero Line Fitted" should be chosen.

Channel Numbers in XDF files

@cbrnr Josef suggested using channel numbers of each stream in XDF files:

For example, instead of doing:

stream 0: 0 1 2 3
stream 1: 4 5 6 7

We do:

stream 0: 0 1 2 3
stream 1: 0 1 2 3

Update README.md and website

I would be happy to revamp the README.md or a webpage if needed. Also we should consider providing pre-built installers in the release tab.

Add support for EEGLAB files

SigViewer should be able to open EEGLAB files, which come in two flavors: (1) either a single .set file or (2) a pair of .set/.fdt files. A .set file is just a renamed .mat file, which in the former case contains both the meta information and the signal data. In the latter case, the .set file contains only the meta information whereas the signal data is stored in a separate .fdt file.

So if the data is available within the .set file, it should be available in EEG.data. If this field does not exist, the data must be retrieved from a separate .fdt file.

I guess we could use the free matio library for this purpose.

Problems converting EDF to GDF

I have downloaded some EDF data from the PhysioNet EEG database. I am able to import the data into sigviewer 0.5.2 and it renders properly. However, when I export the data neither sigviewer nor OpenViBE can read the resulting file.

Add a hotkey help dialog with lists of hotkeys

@cbrnr

Currently there is no way for users to know some hidden hotkeys, such as Ctrl + mouse wheel etc.

I am thinking to add a dialog with all the hotkeys commands listed (analogous to the one below), with an icon next to the zoom in/out. Please let me know what you think.

image

"Delete" button next to event table too large

The delete button next to the event table is too large - it extends from the top until the bottom of the table, at least in some styles it appears to be the case. Since this is actually a vertical toolbar, there should be a way to make this button a fixed height.

Combine the three toolbars into one

I don't see the need for three separate toolbars. Therefore, I suggest to combine them into one toolbar and add separators to group icons accordingly.

Event Stream should explicitly say (events only) in channel dialog

One of our collaborator got seriously confused, saying he never saw the stream he expected... turned out that stream is a text event stream and he was looking for it in the main window... thought it would help if in the channel selection dialog we display it as -text events only- (as we did earlier)

64bit build for Windows

We have 64bit builds for Linux and macOS, but currently we only have 32bit Windows binaries. We should really try to build a 64bit binary also on Windows, because right now this severely limits the capability of opening large files (and this problem seems to occur already with files around 1GB, which are common file sizes for XDF files).

Switch to Qt 5

Project src is not directly supported with new version of QT5. I had to change few syntax change due to transition from Qt4 to Qt5.
Now i'am stuck with errors from external library, i'am not sure how to use them correctly, i got strange errors when compiling.
qt5_errors

Ctrl - works but Ctrl + doesn't...

Ideally the hotkeys should be consistent, plus there should be hotkeys for zoom in/out horizontally as well (currently there are only vertical ones)

Unify/simplify QSettings.

I have concern on this one: What if the user has other Qt built applications on his machine? Then the setting is mixed up with other settings.

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.