Dokumentacja SVAROG: Różnice pomiędzy wersjami

Z Brain-wiki
(Utworzono nową stronę "==Compiling and running Svarog== How to download and compile Svarog on your computer. What to expect during the first run. ==S...")
 
Linia 1: Linia 1:
 
==[[Svarog/Users Manual/Compiling_Svarog|Compiling and running Svarog]]==
 
==[[Svarog/Users Manual/Compiling_Svarog|Compiling and running Svarog]]==
 
How to download and compile Svarog on your computer. What to expect during the first run.
 
How to download and compile Svarog on your computer. What to expect during the first run.
 +
 +
Svarog isn't yet really distributed as a compiled package, so it is best to use the source from the repository and compile and run.
 +
 +
== How to download the development version ==
 +
It's best to download the sources using [http://git-scm.com git].
 +
  git clone git://escher.fuw.edu.pl/git/svarog
 +
This will create directory ''svarog'' populated with the latest version.
 +
 +
If you can't/don't want to use ''git'', you can go to
 +
http://escher.fuw.edu.pl/git/svarog and download one of the ''.tar.bz2'' or ''.zip'' archives using the links on the right hand side.
 +
 +
==Requirements==
 +
#You will need [http://maven.apache.org/ maven].
 +
#protoc from [http://code.google.com/apis/protocolbuffers/docs/overview.html Google Protocol Buffers] version 2.4.x
 +
== How to compile svarog and plugins ==
 +
Change into the directory <tt>svarog</tt> and execute
 +
mvn clean package
 +
 +
This will download the necessary maven plugins
 +
and also some libraries needed by Svarog which are distributed separately.<BR>
 +
Downloaded files go by default into ''~/.m2/repository''.
 +
 +
This command also creates a package of Svarog complete with dependencies in one file (<code>svarog/target/svarog-0.5.0-SNAPSHOT.one-jar.jar</code>).
 +
 +
== How to run (svarog and plugins) ==
 +
In the toplevel ''svarog'' repository execute
 +
  mvn -pl svarog exec:java
 +
 +
When run as a binary, svarog accepts the following options:
 +
 +
usage: /usr/bin/svarog <options>
 +
  -D <arg>        define java property (allowed multiple times)
 +
  -h,--help      display help
 +
  -m,--moltest    include test method
 +
  -R,--reset      reset workspace settings
 +
  -s,--nosplash  don't display splash screen
 +
 +
Those options can be passed to Svarog when launching Svarog using Maven by setting <tt>-Dexec.args=...</tt>. E.g.
 +
  mvn -pl svarog exec:java -Dexec.args=--nosplash
 +
 +
Some options can only be set using Java properties. When using maven to launch Svarog, properties can be set using <tt>-Dproperty=value</tt>.
 +
 +
Useful options include:
 +
 +
* <tt>log4j.debug=true</tt> debug log4j configuration. This is useful to see why logging messages are displayed (or not).
 +
* <tt>signalml.root</tt> specifies the location of the Svarog settings directory.
 +
* <tt>svarog.security_manager=enforcing/permissive/off</tt>. The default is currently <tt>off</tt>. See javadoc:org/signalml/app/SvarogSecurityManager.html for more information.
 +
 +
== Accessing and generating documentation ==
 +
Code is documented through java-docs, which can be accessed online http://signalml.org/svarog/apidocs/index.html.
 +
 +
This documentation can be also generated from the source tree:
 +
  mvn install
 +
  mvn javadoc:javadoc
 +
The generated documents are in the directory target/site/apidocs under the source tree.
 +
 +
== Compiling and running just Svarog ==
 +
If you are not working on the plugins, they don't have to be rebuilt constantly. Compile only svarog with:
 +
  mvn -pl svarog compile
 +
  mvn exec:java
 +
 +
== Troubleshooting ==
 +
=== On Ubuntu 10.4 ===
 +
<pre>
 +
[INFO] Unable to find resource 'flanagan:flanagan:pom:1.0.3' in repository central (http://repo1.maven.org/maven2)
 +
[INFO] [compiler:compile {execution: default-compile}]
 +
[INFO] Compiling 1078 source files to /home/adam/svarog/svarog/target/classes
 +
[INFO] ------------------------------------------------------------------------
 +
[ERROR] BUILD FAILURE
 +
[INFO] ------------------------------------------------------------------------
 +
[INFO] Compilation failure
 +
Unable to locate the Javac Compiler in:
 +
  /usr/lib/jvm/java-6-openjdk/jre/../lib/tools.jar
 +
Please ensure you are using JDK 1.4 or above and
 +
not a JRE (the com.sun.tools.javac.Main class is required).
 +
In most cases you can change the location of your Java
 +
installation by setting the JAVA_HOME environment variable.
 +
</pre>
 +
 +
Instaling openjdk-6-jdk (sudo apt-get install openjdk-6-jdk) helps.
 +
[[category:Svarog]]
 +
 +
=== On various systems ===
 +
<pre>
 +
[INFO] Compilation failure
 +
 +
/home/svarog/tmp/s6/svarog/target/generated-sources/org/signalml/multiplexer/protocol/SvarogProtocol.java:[11,22]
 +
org.signalml.multiplexer.protocol.SvarogProtocol.Variable is not
 +
abstract and does not override abstract method
 +
newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent) in
 +
com.google.protobuf.GeneratedMessage
 +
 +
/home/svarog/tmp/s6/svarog/target/generated-sources/org/signalml/multiplexer/protocol/SvarogProtocol.java:[165,24]
 +
org.signalml.multiplexer.protocol.SvarogProtocol.Variable.Builder is not
 +
abstract and does not override abstract method
 +
internalGetFieldAccessorTable() in
 +
com.google.protobuf.GeneratedMessage.Builder
 +
 +
/home/svarog/tmp/s6/svarog/target/generated-sources/org/signalml/multiplexer/protocol/SvarogProtocol.java:[342,22]
 +
org.signalml.multiplexer.protocol.SvarogProtocol.VariableVector is not
 +
abstract and does not override abstract method
 +
newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent) in
 +
com.google.protobuf.GeneratedMessage
 +
...
 +
</pre>
 +
 +
<tt>protoc</tt> has wrong version. It should be 2.4.
 +
 +
==Installing Svarog from a Debian package (experimental)==
 +
<ol><li>Put <tt>svarog.list</tt> in directory <tt>/etc/apt/sources.list.d/.</tt>:
 +
<source lang="bash">sudo wget -O/etc/apt/sources.list.d/svarog.list http://escher.fuw.edu.pl/debian/svarog.list </source>
 +
<li>Install the gpg key used to verify package signatures:
 +
<source lang="bash">sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 46F44D47 </source>
 +
or alternatively
 +
<source lang="bash">wget -O- http://escher.fuw.edu.pl/debian/gpg.key | sudo apt-key add - </source>
 +
Warning: the key will be changed, right now it is [[User:ZbyszekSzmek|my personal key]].
 +
<li>Update the list of available packages with
 +
<source lang="bash">sudo apt-get update </source>
 +
<li>Svarog can be installed with
 +
<source lang="bash">sudo apt-get install svarog </source>
 +
</ol>
 +
 +
 +
'''This package does not work on UBUNTU.'''
 +
 +
==Examples==
 +
Examples of biomedical signals that can be viewed using Svarog can be found [http://brain.fuw.edu.pl/~zbyszek/eeg/dane/ here]. One can download them using <tt>wget</tt>.
 +
<source lang="bash">wget -np -r -l5 -c http://brain.fuw.edu.pl/~zbyszek/dane</source>
 +
'''Warning''': The files are big.
 +
==First run==
 +
During the first run of Svarog user makes important decisions about Svarog's appearance.
 +
# Chooses the language Svarog is going to use &mdash; either English or Polish (Fig. <xr id="rys_1"/>). [[File:Svarog 1 uruchomienie 0.png|center|thumb|500px|<figure id="rys_1"/>Choosing language]]
 +
# Chooses directory, where Svarog will store its configuration and files (Fig. <xr id="rys_2"/>). One can store them in <tt>signalml</tt> directory inside default home or choose custom location (Fig. <xr id="rys_3"/>).[[File:Svarog 1 uruchomienie 2.png|thumb|500px|center|<figure id="rys_2"/>Choosing location of configuration storage.]]
 +
# To change the chosen language it is necessary to remove the <tt>signalml</tt> directory.[[File:Svarog 1 uruchomienie 3.png|thumb|500px|center|<figure id="rys_3"/>Custom location]]
 +
#Before accessing Svarog GUI <xr id="rys_5"/>, one gets the final warning <xr id="rys_4"/>.[[File:Svarog 1 uruchomienie 4.png|thumb|800px|center|<figure id="rys_4"/>Final warning]][[File:Svarog_uruchomiony.png|thumb|800px|center|<figure id="rys_5"/>Svarog]]
 +
 +
 +
==Disabling warnings==
 +
Default Svarog warnings might be annoying. In order to disable them, choose <tt>Edit -> Preferences</tt>. Open tab <tt> Miscellaneous</tt>, choose <tt>Disable serious warning dialagos for preset operations</tt> as in Fig <xr id="fig:rys_6"/>.
 +
 +
[[File:Svarog preferences disable warnings.png|thumb|600px|center|<figure id="fig:rys_6"/> Disabling warnings]]
 +
 
==[[Svarog/Users Manual/Loading signal|Loading signals]]==
 
==[[Svarog/Users Manual/Loading signal|Loading signals]]==
 
How to load signal:
 
How to load signal:

Wersja z 07:24, 27 lip 2015

Compiling and running Svarog

How to download and compile Svarog on your computer. What to expect during the first run.

Svarog isn't yet really distributed as a compiled package, so it is best to use the source from the repository and compile and run.

How to download the development version

It's best to download the sources using git.

 git clone git://escher.fuw.edu.pl/git/svarog

This will create directory svarog populated with the latest version.

If you can't/don't want to use git, you can go to http://escher.fuw.edu.pl/git/svarog and download one of the .tar.bz2 or .zip archives using the links on the right hand side.

Requirements

  1. You will need maven.
  2. protoc from Google Protocol Buffers version 2.4.x

How to compile svarog and plugins

Change into the directory svarog and execute

mvn clean package

This will download the necessary maven plugins and also some libraries needed by Svarog which are distributed separately.
Downloaded files go by default into ~/.m2/repository.

This command also creates a package of Svarog complete with dependencies in one file (svarog/target/svarog-0.5.0-SNAPSHOT.one-jar.jar).

How to run (svarog and plugins)

In the toplevel svarog repository execute

 mvn -pl svarog exec:java

When run as a binary, svarog accepts the following options:

usage: /usr/bin/svarog <options>
  -D <arg>        define java property (allowed multiple times)
  -h,--help       display help
  -m,--moltest    include test method
  -R,--reset      reset workspace settings
  -s,--nosplash   don't display splash screen

Those options can be passed to Svarog when launching Svarog using Maven by setting -Dexec.args=.... E.g.

 mvn -pl svarog exec:java -Dexec.args=--nosplash

Some options can only be set using Java properties. When using maven to launch Svarog, properties can be set using -Dproperty=value.

Useful options include:

  • log4j.debug=true debug log4j configuration. This is useful to see why logging messages are displayed (or not).
  • signalml.root specifies the location of the Svarog settings directory.
  • svarog.security_manager=enforcing/permissive/off. The default is currently off. See javadoc:org/signalml/app/SvarogSecurityManager.html for more information.

Accessing and generating documentation

Code is documented through java-docs, which can be accessed online http://signalml.org/svarog/apidocs/index.html.

This documentation can be also generated from the source tree:

 mvn install
 mvn javadoc:javadoc

The generated documents are in the directory target/site/apidocs under the source tree.

Compiling and running just Svarog

If you are not working on the plugins, they don't have to be rebuilt constantly. Compile only svarog with:

 mvn -pl svarog compile
 mvn exec:java

Troubleshooting

On Ubuntu 10.4

[INFO] Unable to find resource 'flanagan:flanagan:pom:1.0.3' in repository central (http://repo1.maven.org/maven2)
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 1078 source files to /home/adam/svarog/svarog/target/classes
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
Unable to locate the Javac Compiler in:
  /usr/lib/jvm/java-6-openjdk/jre/../lib/tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable.

Instaling openjdk-6-jdk (sudo apt-get install openjdk-6-jdk) helps.

On various systems

[INFO] Compilation failure

/home/svarog/tmp/s6/svarog/target/generated-sources/org/signalml/multiplexer/protocol/SvarogProtocol.java:[11,22]
org.signalml.multiplexer.protocol.SvarogProtocol.Variable is not
abstract and does not override abstract method
newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent) in
com.google.protobuf.GeneratedMessage

/home/svarog/tmp/s6/svarog/target/generated-sources/org/signalml/multiplexer/protocol/SvarogProtocol.java:[165,24]
org.signalml.multiplexer.protocol.SvarogProtocol.Variable.Builder is not
abstract and does not override abstract method
internalGetFieldAccessorTable() in
com.google.protobuf.GeneratedMessage.Builder

/home/svarog/tmp/s6/svarog/target/generated-sources/org/signalml/multiplexer/protocol/SvarogProtocol.java:[342,22]
org.signalml.multiplexer.protocol.SvarogProtocol.VariableVector is not
abstract and does not override abstract method
newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent) in
com.google.protobuf.GeneratedMessage
...

protoc has wrong version. It should be 2.4.

Installing Svarog from a Debian package (experimental)

  1. Put svarog.list in directory /etc/apt/sources.list.d/.:
    sudo wget -O/etc/apt/sources.list.d/svarog.list http://escher.fuw.edu.pl/debian/svarog.list
    
  2. Install the gpg key used to verify package signatures:
    sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 46F44D47
    

    or alternatively

    wget -O- http://escher.fuw.edu.pl/debian/gpg.key | sudo apt-key add -
    

    Warning: the key will be changed, right now it is my personal key.

  3. Update the list of available packages with
    sudo apt-get update
    
  4. Svarog can be installed with
    sudo apt-get install svarog
    


This package does not work on UBUNTU.

Examples

Examples of biomedical signals that can be viewed using Svarog can be found here. One can download them using wget.

wget -np -r -l5 -c http://brain.fuw.edu.pl/~zbyszek/dane

Warning: The files are big.

First run

During the first run of Svarog user makes important decisions about Svarog's appearance.

  1. Chooses the language Svarog is going to use — either English or Polish (Fig. Figure 1).
  2. Chooses directory, where Svarog will store its configuration and files (Fig. Figure 2). One can store them in signalml directory inside default home or choose custom location (Fig. Figure 3).
    Plik:Svarog 1 uruchomienie 2.png
    Choosing location of configuration storage.
  3. To change the chosen language it is necessary to remove the signalml directory.
  4. Before accessing Svarog GUI Figure 5, one gets the final warning Figure 4.


Disabling warnings

Default Svarog warnings might be annoying. In order to disable them, choose Edit -> Preferences. Open tab Miscellaneous, choose Disable serious warning dialagos for preset operations as in Fig Figure 6.

Loading signals

How to load signal:

Viewing books

How to open and browse books (representations of signals obtained by MP decomposition).

Recording signals

How to record signals using Svarog.

Montage

How to change, choose and save signal montages.

Filtering

How to filter the signal.

Tagging signals

How to tag an offline signal.

Online/Offline FFT tool

How to check the frequency content using FFT.

Signal decomposition using Matching Pursuit

How to decompose the signal using the Matching Pursuit algorithm

Average Evoked Potentials

How to compute Average Evoked Potentials using Svarog.

Automatic sleep staging

How to automatically stage sleeps EEG, obtaining a polysomnogram.

Automatic artifact detection

How to perform automatic EEG artifact detection using Svarog.

Preset interface in Svarog

Saving configuration and settings in Svarog.

Export to EEGLab

Svarog allows to export the currently opened signal to EEGLab.

How to

  1. Change electrode names.
  2. Check quality of the signal received online.
  3. Add EEG cap type