Table Of Contents

Previous topic

What’s new

Next topic

Manual

This Page

Getting started

Introduction

This is a an OpenElectrophy, one hour, User Interface (UI) tutorial.

This page aims to present a step by step example of how to use the OpenElectrophy graphical user interface. Briefly, it shows an example of how to insert new data into the database, how to visualize and explore these new data, and finally how to detect events of interest like spikes and oscillations. More detailed informations about all these steps can be found in the Manual. Moreover, this page is an introduction to the UI only, if you want an introduction on how to write analysis script with OpenElectrophy Python classes, please refer to Scripting with OpenElectrophy.

Before starting

Before starting you need to have Python and OpenElectrophy properly installed on your computer. See Installation section.

For a better understanding it is a good idea to also read the Class Definitions section.

Starting UI

Os:
  • Linux : open a console (terminal) type startOpenElectrophy
  • Windows : click (or make a shortcut on your desktop) on c:\python26\Lib\site-packages\OpenElectrophy.egg\EGG-INFO\scripts\startOpenElectrophy

Creating an empty database

OpenElectrophy deals with MySQL server or an SQLite database file. It is easier to start with a SQLite file. So we use this in the demo but keep in mind that the MySQL server is more powerful.

Click on Database -> create a new database. Choose SQLite. Choose a working dir and a database name, test

_images/create_sqlite1.png

Logging to the MySQL database schema

Click on Menu : Database -> open database. Choose SQLite. Choose the created db : test.db

_images/open_sqlite1.png

If the database you have selected is empty, you should now face the standard OpenElectrophy window with no data.

schemabase/papamaman.png

Inserting new data

To import data, in the Menu: Database -> import data in this db :

  • In the upper left corner, you can choose the file type of the data you want to import. OpenElectrophy knows many common formats of electrophysiological systems.
  • For this tutorial, we will choose : tryit. This is a fake IO. It does not read/write any file. It generates a full set of data with many features : Block, Segments, AnalogSignals, Events, ...
  • Select the options tab
  • Leave all options by default and click Open.
_images/import_data_example1.png

Exploring and visualizing stored data

The data are now stored in the database. Sometimes in order to see them in OpenElectrophy you need to refresh the knowledge OpenElectrophy has of the database. For that click on the upper right button -> popup menu -> refresh view.

_images/refresh_view2.png

A new line “block id : 1” appeared in the “Hierarchic explorer”. This explorer is a tree view of the database content. You can unfold the tree content by clicking on the crosses at the beginning of each line and get something like this:

_images/first_view2.png

You can observe that we have one block, in which are present 5 segments, in which are presents 4 analogsignals.

But with a db, you can have many views on your data. Click on the tab ByRecordingPoint and you get another view: one block, in which are present 4 recordingpoints, in which are presents 5 analogsignals. The data are the same, only the way they are viewed is different.

_images/second_view1.png

If you right-click on any line, you get a contextual menu which is object-dependent. For example, if you right click on any block you have:

_images/right_click1.png

If you choose the “edit fields” options, you have access to the parameters related to the block stored in the database and managed by OpenElectrophy. You can simply modify any of these fields but you need to click on the “save to the database” button to get the new parameter values stored into the database.

_images/edit_fields11.png

Plot analogsignal

Now let’s plot the data. The simplest way is to select an analogsignal in the hierarchical tree view and then click on the button “Draw” on the upper left of the main window. You should get something like this:

_images/draw11.png

The menu on the left of the plot allows to zoom and move into the graph in different ways, to save the graph and finally to close it.

Different types of plots can be simply made. The plots made when you hit the “Draw” button are selected by the checked boxes in the lower-left corner of the main window: the FigureTools. Note that different types of plots are available for each type of object. For example, for analogsignal you can choose and/or : natural, filtered, scalogram. All, this plotting capabilities have options.

  • Select both filtered, scalogram.
  • Check related options.
  • Press draw again and you should get the same filtered signal and its time-frequency map in color scale computed with a Morlet wavelet.

Note that, filtered and scalogram are computed on the fly. You do not need to pre-compute them, store them and plot them.

_images/draw21.png

Detecting oscillations

On the last time-frequency plot you observed nice red blobs between 20 and 80 Hz. One of the main feature of OpenElectrophy is to give a full interface to properly detect such oscillatory episodes and get their instantaneous phase, frequency and energy at each time point. All detected oscillations can then be stored in the database and retrieved later for visualization or analysis. For example we will detect the oscillations of our current AnalogSignal. For that, first right-click on the wanted “AnalogSignal” in the tree view to get the electrode contextual menu and select “edit oscillation”:

_images/right_click_edit_oscillations2.png

You get the “detect oscillation window”:

_images/edit_oscillation_empty2.png
Here is a brief description of this window :
  • Parameter for scalogram is related to parameters used to compute the morlet time-frequency scalogram
  • Detection zone describes the zone where you want to detect transient oscillations.
  • Threshold is a crucial point. Start with an absolute threshold and play with it.
  • Clean is a more advanced concept to eliminate “bad” oscillations detected by the method.
Under each parameter box you can press the related button to see what happens:
  • Compute scalogram
  • Redraw signal
  • Detect max and Compute lines
  • Clean list

You should get something like that:

_images/edit_oscillation_first1.png

If you zoom on an oscillation (zoom or double click in the list), you can observe that:

If you zoom on the time-frequency map you can observe that the oscillation (in magenta) follows the ridge of the energy blob. The computation of the wavelet transform of the signal at each point of this line gives the oscillation instantaneous phase, frequency and energy. The phase is used to plot the oscillation superimposed on the raw signal above.

_images/edit_oscillation_zoom2.png

To finish, you can save these oscillations (precisely you save the line in the time-frequency map) into the database by clicking on the “Save to db (no delete)” button.

Detecting spikes

If you observe in details the raw signal of the previous electrode, you should have noticed very short and large amplitude events which are spikes recorded extracellularly. OpenElectrophy provides the necessary tools to (almost) automatically detect these spikes (and sort them if multiple cells are recorded on the same electrode). To detect spikes, select the tab “spike by recording point”, right-click on a recordingpoint and select “Spike sorting (mode = from full band signal)”

_images/right_click_spikesorting2.png

Importantly, note that this demo signal mimics a tetrode. In short this recordingpoint belongs to a group of 4 recordingpoints. In this case OpenElectrophy spikesorting deals automatically with all 4 signals. The spike sorting dialog a many widget that the user can arrange in views. All widget are dockable. They can be visible or not. The spike sorting process is decomposed in 5 steps. One of these widgets is noted steps. It allow to compute step by step the spike sorting. Each step has its own tab. For each step, you can choose the method you want.

_images/spikesorting_steps1.png

Let’s compute all steps one by one :

  • Filtering You can select the FFT filtering method and see the result in Filtered signal widget.
_images/spikesorting_filtering1.png
  • Detection You can choose absolut, std or median threshold.
_images/spikesorting_detection1.png
  • Extraction You can choose the alignment.
_images/spikesorting_extraction1.png
  • Projection Choose principal component.
_images/spikesorting_features1.png
  • Clustering Choose K-Mean with 3 clusters.
_images/spikesorting_clustering1.png

Before saing the result in the database you can have global view on your spiketrain and see the association to neuron and segment:

_images/spikesorting_summary1.png

And then press save :

_images/spikesorting_database1.png

Create a new view

One of the of the strength of OpenElectrophy is to use a database schema for managing large datasets.

A schema allows to explore data with different views. You can observe that at the first connection OpenElectrophy proposes 4 tabs with 4 differents views.

One is adapted to view AnalogSignals in their Segments.

Another is adapted to explore detected neurons.

A third show Spiketrains in their Recordingpoints.

But you can create your own view, click on setting in the upper left corner:

  • Give a name to your view, for example “Signal and Oscillations”.
  • Drag and drop the tables you want in your view.
  • Select the top hierachy (table considered as the root of your tree).
_images/table_designer1.png

You will get this new view :

_images/new_view2.png