/usr/share/doc/spykeviewer/html/usage.html is in spykeviewer 0.4.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Usage — Spyke Viewer 0.4.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.4.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/copybutton.js"></script>
<link rel="shortcut icon" href="_static/icon.ico"/>
<link rel="top" title="Spyke Viewer 0.4.1 documentation" href="index.html" />
<link rel="next" title="Plugins" href="plugins.html" />
<link rel="prev" title="Installation" href="installation.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="plugins.html" title="Plugins"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="installation.html" title="Installation"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Spyke Viewer 0.4.1 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="usage">
<span id="id1"></span><h1>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h1>
<p>This section gives a tutorial of the main functionality of Spyke Viewer. To
follow the examples, you need to download and unpack the <a class="reference external" href="http://www.ni.tu-berlin.de/fileadmin/fg215/software/SPYKE/sampledata.zip">sample data file</a>.
It contains simulated data for two tetrodes over 4 trials. For each tetrode,
there are 5 simulated neurons with corresponding spike trains and prototypical
template waveforms included.</p>
<p>When you start Spyke Viewer for the first time, you will see the following
layout:</p>
<img alt="_images/initial-layout.png" src="_images/initial-layout.png" />
<p>All elements of the user interface are contained in docks and can be
rearranged to suit your needs. Their layout is saved when you close Spyke
Viewer. The “View” menu shows all available docks and panels, you can also
hide and show them from this menu.</p>
<div class="section" id="loading-data">
<h2>Loading Data<a class="headerlink" href="#loading-data" title="Permalink to this headline">¶</a></h2>
<p>The first thing you want to do when using Spyke Viewer is to load your data.
The <em>Files</em> dock contains a view of all the files on your system. You can
use it to select one or more files, then click on the “Load” button below to
load the selected files into Spyke Viewer. Single files can also be loaded
with a double click (this does not work for directories, they will just be
expanded. If you want to load a directory, you need to use the “Load” button).
Alternatively, you can use the “Load Data...” option in the “File” menu to
open a dialog that allows you to select files to load. Now find and select
the file “sample.h5” that you just unpacked (an HDF5 File) and load it.</p>
<p>The data file input/output is based on <tt class="xref py py-mod docutils literal"><span class="pre">neo</span></tt> and supports formats that
have a
<a class="reference external" href="http://neo.readthedocs.org/en/latest/io.html">Neo IO class</a>. For each
selected file, the filetype and corresponding IO class is selected
automatically from the file extension. If you want to specify which IO class
to use, you can do so in the “Format” list in the <em>Files</em> dock. When you
select a format with read or write parameters, you can click “Configure
selected IO” to change the parameters. The IO and parameters you choose in
the <em>Files</em> dock are also used when loading files using the “File” menu. If
you want to use a file format that is not supported by Neo, you can write a
plugin: <a class="reference internal" href="extending.html#ioplugins"><em>IO plugins</em></a>.</p>
<p>Spyke Viewer and Neo include some features to handle very large data sources
that are larger than the main memory or take very long to load. If you want
to learn about these features, go to <a class="reference internal" href="lazy.html"><em>Lazy Features</em></a>.</p>
</div>
<div class="section" id="selections">
<span id="id2"></span><h2>Selections<a class="headerlink" href="#selections" title="Permalink to this headline">¶</a></h2>
<p>Now that a file was loaded, some entries have appeared in the <em>Navigation</em>
dock. To understand how to navigate data with Spyke Viewer, you need to know
the Neo object model. The following picture is a complete representation:</p>
<img alt="_images/neo.png" src="_images/neo.png" />
<p>The rectangular objects are containers, rounded corners indicate a data
object. The arrows represent a “contains zero or more” relationship. Note that
all data objects belong to a segment and some also belong to other objects.
For example, a SpikeTrain is referenced by both Segment and Unit. A unit often
represents a single neuron (it is named unit because putative neurons from
spike sorting are called units), but it could also represent the results of
a spike detection algorithm and therefore include multiple neurons. Each
SpikeTrain is specific to one Segment and one Unit, and each Segment or Unit
could contain many SpikeTrains. For more detailed information on the Neo
object model, see the
<a class="reference external" href="http://neo.readthedocs.org/en/latest/core.html">Neo documentation</a>.</p>
<p>In Spyke Viewer, you use the <em>Navigation</em> dock to select container objects.
There is a list for each type of container where you can select an arbitrary
set of entries. You can select multiple entries by clicking and dragging or
using the control key when clicking. Each list will only show those
objects of the respective type that are contained in selected objects further
up in the hierarchy. For example, try selecting a different recording channel
group and observe how the channels and units list change. To help you
navigate, all objects in the <em>Navigation</em> dock are automatically assigned a
unique identifier which includes the identifier of containing objects. The
identifiers are shown in parentheses after the objects name (if an object has
no name, only the identifier is shown). Blocks use capital letters; recording
channel groups use small letters; recording channels, units and segments use
numbers. For example, a unit might have an identifier “A-b-2”: This denotes
unit number 2 of recording channel group “b” of block “A”. The identifiers are
recreated whenever the structure of the loaded data changes - they are just
a visual aid to help with navigation and ensure that unnamed objects have
a reasonable label.</p>
<p>Each list in the <em>Navigation</em> dock has a context menu accessed by
right-clicking or control-clicking on OS X. You can use it to remove the
selected objects (they will only be removed from Spyke Viewer, not from the
loaded files) or open an annotation editor for the current object. The
annotation editor can also be opened by double-clicking a list entry.</p>
<p>The sets of selected objects from all container types is called a selection.
The selected items you see in the <em>Navigation</em> dock are called the current
selection. Selections determine which data will be analyzed by plugins (see
<a class="reference internal" href="plugins.html#plugins"><em>Plugins</em></a>) and can be accessed by the internal console (see
<a class="reference internal" href="#console"><em>Using the Console</em></a>). You can save a selection using the
“Selections” menu: Click on the menu and then on “New”. An additional entry in
the “Selections” menu called “Selection 1” will appear. Each selection entry
has a submenu where you can load, save, rename or delete the selection. Try
selecting something else in the <em>Navigation</em> dock and creating a new
selection again. Now try to load your first selection and observe how the
<em>Navigation</em> dock changes to reflect what you have loaded. If you use the
entry “Save” from a selection, it will be overwritten with the current
selection. You can also change the order of the saved selections by dragging
the entries in the “Selections” menu:</p>
<img alt="_images/selections-menu.png" src="_images/selections-menu.png" />
<p>All saved selections together with the current selection are called a
selection set. You can save your current selection set as a file (in
<a class="reference external" href="http://www.json.org">JSON</a> format, so it can easily be read and edited
by humans or other software) using “Save Selection Set...” in the “File” menu.
When you load a selection set, your current selection is replaced by the
current selection from the file. The other selections in the file are added
to your current saved selections. If a selection set includes files that are
not currently loaded, they are opened automatically. When you exit Spyke
Viewer, your current selection set is saved and will be restored on your
next start.</p>
</div>
<div class="section" id="exporting-data">
<h2>Exporting Data<a class="headerlink" href="#exporting-data" title="Permalink to this headline">¶</a></h2>
<p>If you want to export your data, Spyke Viewer offers two entries in the “File”
menu: “Save selected data...” exports all data in your current selection.
“Save all data...” exports all loaded data. When you click on one of
the items, a dialog will open asking you where you want to save the data and
in which format. HDF5 and Matlab are available. It is strongly recommended to
save your data in HDF5, since the Neo IO for Matlab currently does not support
the whole object model – RecordingChannelGroups, RecordingChannels and Units
are not saved.</p>
<p>Matlab has an interface for loading HDF5 files as well, so if you want
to load your data in Matlab without losing some of the structure, you can use
HDF5. On the other hand, if you want to get your data into Matlab quickly or
it is structured with segments only, the Matlab export could be the right
choice.</p>
</div>
<div class="section" id="filters">
<h2>Filters<a class="headerlink" href="#filters" title="Permalink to this headline">¶</a></h2>
<img alt="_images/filterdock.png" src="_images/filterdock.png" />
<p>When dealing with large datasets, it can be inconvenient to create a selection
from the full lists of containers. The filter system provides a solution to
this problem. By creating filters, you can determine what objects are
shown in the <em>Navigation</em> dock. For example, you might want to temporarily
exclude RecordingChannelGroups that have no attached units or only display
Segments with a certain stimulus. Creating filters requires basic knowledge
of Python and the Neo object model.</p>
<p>You can manage your filters with the <em>Filter</em> dock and toolbar (which is
positioned on the upper left in the initial layout). When you start Spyke
Viewer for the first time, the <em>Filter</em> dock will be empty. You can create
a new filter by clicking on “New Filter” in the toolbar (right-clicking the
<em>Filter</em> dock also brings up a menu with available actions). You can choose
what kind of container objects the filter applies to, the name of the filter
and its content: a simple Python function.</p>
<p>There are two kinds of filters: single or combined. Single filters (created
when the “Combined” checkbox is unchecked) get a single Neo object and return
<tt class="docutils literal"><span class="pre">True</span></tt> if the object should be displayed and <tt class="docutils literal"><span class="pre">False</span></tt> if not. Combined
filters get a list of Neo objects and return a list containing only objects
that should displayed. The order of the returned list is used for subsequent
filters and displaying, so combined filters can also be used to sort the
object lists.</p>
<p>For both kinds of filters, the signature of the function is fixed and
shown at the top of the window, so you only have to write the function body.
The “True on exception” checkbox determines what happens when the filter
function raises an exception: If it is checked, an exception will not cause
an element to be filtered out, otherwise it will. The following picture shows
how you would create a filter that hides all units that do not have at least
two SpikeTrains attached:</p>
<img alt="_images/newfilter.png" src="_images/newfilter.png" />
<p>As another example, to reverse the order of Segments, you could create
combined Segment filter with the following line:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">return</span> <span class="n">segments</span><span class="p">[::</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
</pre></div>
</div>
<p>You can also create filter groups. They can be used to organize your filters,
but also have an important second function: You can define groups in which
only one filter can be active. If another filter in the group is activated,
the previously active filter will be deactivated. You can choose which filters
are active in the <em>Filter</em> dock. The <em>Navigation</em> dock will be updated
each time the set of active filters changes. You can also drag and drop
filters inside the <em>Filter</em> dock. Their order in the <em>Filter</em> dock determines
the order in which they are applied. All filters and their activation
state are saved when you exit Spyke Viewer.</p>
</div>
<div class="section" id="using-plugins">
<span id="usingplugins"></span><h2>Using Plugins<a class="headerlink" href="#using-plugins" title="Permalink to this headline">¶</a></h2>
<p>Once you have selected data, it is time to analyze it. Spyke Viewer includes
a number of plugins that enable you to create various plots from your data.
Select the <em>Plugins</em> dock (located next to the <em>Filter</em> dock in the
initial layout) to see the list of available plugins. To start a plugin,
simply double-click it or select it and then click on “Run Plugin” in the
plugin toolbar or menu (there is also a context menu available when you
right-click a plugin). You can also start a plugin in a different process
(so that you can continue using Spyke Viewer while the plugin is busy) by
selecting “Start with Remote Script” in the “Plugins” menu.</p>
<p>For example, if you start the “Signal Plot” plugin, it will create a plot of
selected analog signals. Try selecting Segment 3, Tetrode 2 and Channels 3
and 4. When you now start the plugin, you will see the signals of the selected
channels in Segment 3. Now select some units and then open the plugin
configuration by clicking on “Configure Plugin” on the plugin toolbar or
menu. Select “Show Spikes” and set “Display” to “Lines”. When you now start
the plugin, you will see the analog signals and the spike times of your
selected units. Go to the configuration again, set “Display” to “Waveforms”
and check “Use first spike as template”. After another run of the plugin,
you will see the template spike waveforms overlaid on the analog signals. The
configuration of all plugins is saved when you close Spyke Viewer and will
be restored on the next start. To set the configurations of all plugins back
to their default values, use “Restore Plugin configurations” from the
“Plugins” menu.</p>
<p>To learn more about the included plugins and how to use them, go to
<a class="reference internal" href="plugins.html#plugins"><em>Plugins</em></a>. When you want to create your own plugins, go to
<a class="reference internal" href="extending.html#analysisplugins"><em>Analysis plugins</em></a>.</p>
</div>
<div class="section" id="using-the-console">
<span id="console"></span><h2>Using the Console<a class="headerlink" href="#using-the-console" title="Permalink to this headline">¶</a></h2>
<p>With the integrated console, you can use the full power of Python in Spyke
Viewer, with access to your selected data. Open the <em>Console</em> dock by
clicking on the “View” menu and selecting “Console”. You can explore your
workspace using the <em>Variable Explorer</em> dock and view your previous
commands with the <em>Command History</em> dock. Some packages like <a class="reference external" href="http://scipy.org/">scipy</a> and
<tt class="xref py py-mod docutils literal"><span class="pre">neo</span></tt> are imported on startup, the message in the console shows which.
The console features autocompletion (press the Tab key to complete with the
selected entry) and docstring popups.</p>
<p>The most important objects in the console environment are <tt class="docutils literal"><span class="pre">current</span></tt> and
<tt class="docutils literal"><span class="pre">selections</span></tt>. <tt class="docutils literal"><span class="pre">current</span></tt> gives you access to your currently selected data,
<tt class="docutils literal"><span class="pre">selections</span></tt> contains all stored selections (which you can manage using
the “Selections” menu, see <a class="reference internal" href="#selections">selections</a>). For example,</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">current</span><span class="o">.</span><span class="n">spike_trains</span><span class="p">()</span>
</pre></div>
</div>
<p>gives a list of your currently selected spike trains. Both <tt class="docutils literal"><span class="pre">current</span></tt> and
the entries of <tt class="docutils literal"><span class="pre">selections</span></tt> are
<tt class="xref py py-class docutils literal"><span class="pre">spykeutils.plugin.data_provider.DataProvider</span></tt> objects, refer to the
documentation for details of the methods provided by this class.</p>
<p>As an example, to view the total amount of spikes in your selected spike
trains for each segment, enter the following lines:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">trains</span> <span class="o">=</span> <span class="n">current</span><span class="o">.</span><span class="n">spike_trains_by_segment</span><span class="p">()</span>
<span class="gp">>>> </span><span class="k">for</span> <span class="n">s</span><span class="p">,</span> <span class="n">st</span> <span class="ow">in</span> <span class="n">trains</span><span class="o">.</span><span class="n">iteritems</span><span class="p">():</span>
<span class="gp">... </span> <span class="k">print</span> <span class="n">s</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="s">'-'</span><span class="p">,</span> <span class="nb">sum</span><span class="p">((</span><span class="nb">len</span><span class="p">(</span><span class="n">train</span><span class="p">)</span> <span class="k">for</span> <span class="n">train</span> <span class="ow">in</span> <span class="n">st</span><span class="p">)),</span> <span class="s">'spikes'</span>
</pre></div>
</div>
<p>Note that the variables used in these lines have now appeared in the
<em>Variable Explorer</em> dock.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>If you have at least IPython 0.12 and the corresponding Qt console
installed, Spyke Viewer will include an <em>IPython</em> dock (accessible under
the “View” menu). It can be used as an alternative to the integrated
console if you prefer IPython. The <tt class="docutils literal"><span class="pre">current</span></tt> and <tt class="docutils literal"><span class="pre">selections</span></tt> objects
are defined as in the integrated console, but no imports are predefined.
You can enter the “magic command”:</p>
<div class="highlight-python"><pre>%pylab</pre>
</div>
<p class="last">to use the PyLab environment (you can safely ignore the warning message
about matplotlib backends). Note that the <em>Variable Explorer</em> and
<em>Command History</em> docks, as well as exceptions from plugins, are only
available on the internal console.</p>
</div>
</div>
<div class="section" id="settings">
<span id="id3"></span><h2>Settings<a class="headerlink" href="#settings" title="Permalink to this headline">¶</a></h2>
<p>The Spyke Viewer settings can be accessed by opening the “File” menu and
selecting “Settings” (on OS X, open the “Spyke Viewer” menu and select
“Preferences”). You can adjust various paths in the settings:</p>
<dl class="docutils">
<dt><strong>Selection path</strong></dt>
<dd>The path where your selections are stored when you exit Spyke Viewer. This
is also the default directory when using “Save Selection Set...” or
“Load Selection Set...” in the “File” menu.</dd>
<dt><strong>Filter path</strong></dt>
<dd>The directory where your filter hierarchy and activation states are stored
when you exit Spyke Viewer. Your filters are stored as regular Python
files with some special annotation comments, so you can edit them in your
favourite editor or share them with other users of Spyke Viewer.</dd>
<dt><strong>Data path</strong></dt>
<dd>This directory is important when you are using the data storage features
of <tt class="xref py py-class docutils literal"><span class="pre">spykeutils.plugin.analysis_plugin.AnalysisPlugin</span></tt>.</dd>
<dt><strong>Remote script</strong></dt>
<dd>A script file that is executed when you use “Start with remote script”
action for a plugin. The default script simply starts the plugin locally,
but you can write a different script for other purposes, e.g. starting it
on a server.</dd>
<dt><strong>Plugin paths</strong></dt>
<dd><p class="first">These are the search paths for plugins. They will be recursively searched
for Python files containing AnalysisPlugin classes. Subdirectories will be
displayed as nodes in the <em>Plugins</em> dock.</p>
<p class="last">In addition, your IO plugins also have to stored be in one of the plugin
paths. The search for IO plugins is not recursive, so you have to put
them directly into one of the paths in this list.</p>
</dd>
</dl>
<p>More configuration options can be set using the <a class="reference internal" href="api.html#api"><em>API</em></a>, for example in the
<a class="reference internal" href="extending.html#startup"><em>Startup script</em></a>.</p>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="index.html">
<img class="logo" src="_static/logo.png" alt="Logo"/>
</a></p>
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Usage</a><ul>
<li><a class="reference internal" href="#loading-data">Loading Data</a></li>
<li><a class="reference internal" href="#selections">Selections</a></li>
<li><a class="reference internal" href="#exporting-data">Exporting Data</a></li>
<li><a class="reference internal" href="#filters">Filters</a></li>
<li><a class="reference internal" href="#using-plugins">Using Plugins</a></li>
<li><a class="reference internal" href="#using-the-console">Using the Console</a></li>
<li><a class="reference internal" href="#settings">Settings</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="installation.html"
title="previous chapter">Installation</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="plugins.html"
title="next chapter">Plugins</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/usage.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="plugins.html" title="Plugins"
>next</a> |</li>
<li class="right" >
<a href="installation.html" title="Installation"
>previous</a> |</li>
<li><a href="index.html">Spyke Viewer 0.4.1 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2012, Robert Pröpper.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.
</div>
</body>
</html>
|