/usr/share/doc/python-neuroshare-doc/index.html is in python-neuroshare-doc 0.9.2-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 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 | <!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>Python Bindings for Neuroshare — Python-Neuroshare documentation</title>
<link rel="stylesheet" href="_static/flasky.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '',
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>
<link rel="top" title="Python-Neuroshare documentation" href="#" />
</head>
<body>
<div class=indexwrapper>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="python-bindings-for-neuroshare">
<h1>Python Bindings for Neuroshare<a class="headerlink" href="#python-bindings-for-neuroshare" title="Permalink to this headline">¶</a></h1>
<p>The Neuroshare API is a standardized interface to access
electrophysiology data stored in various different file
formats. To do so, it uses format- specific shared libraries.
Refer to the official website</p>
<blockquote>
<div><a class="reference external" href="http://neuroshare.org">http://neuroshare.org</a></div></blockquote>
<p>for more information.</p>
<p>The aim of this library is to provide a high level interface
to the Neuroshare API, i.e. it focuses on API usability more
then being a mere python version of the C API. Thus none of
the original Neuroshare API calls are directly exposed but
the interface consists of python objects that resemble (more
or less) the Neuroshare Entities.</p>
<div class="section" id="installation">
<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h2>
<p>The compile-time requirements for python-neuroshare are the
‘setuptools’ and the Python development files and a working
C compiler (clang or gcc) and NumPy. For Debian based
distributions, e.g. Ubuntu, this can easily be done with:</p>
<div class="highlight-python"><div class="highlight"><pre>$ sudo apt-get install clang python-setuptools \
python-dev python-numpy
</pre></div>
</div>
<p>After that, python-neuroshare is installed with the following
command:</p>
<div class="highlight-python"><div class="highlight"><pre>$ sudo python setup.py install
</pre></div>
</div>
<dl class="docutils">
<dt>Additional runtime dependencies:</dt>
<dd><ul class="first last simple">
<li>The Neuroshare vendor DLLs for the specific data file(s)!
Please refer to the following section for more information.</li>
</ul>
</dd>
</dl>
<div class="section" id="installation-of-vendor-dlls">
<h3>Installation of vendor DLLs<a class="headerlink" href="#installation-of-vendor-dlls" title="Permalink to this headline">¶</a></h3>
<p>Python-neuroshare relies on the vendor specific DLLs to
access data files. Therefore the specific DLLs for each
type of file must be downloaded and installed into one of
the following locations:</p>
<div class="highlight-python"><div class="highlight"><pre>/usr/local/lib/neuroshare
/usr/lib/neuroshare
~/.neuroshare
</pre></div>
</div>
<p>A (possibly incomplete) list of the vendor specific DLLs
can be obtained be obtained from the neuroshare website:</p>
<blockquote>
<div><a class="reference external" href="http://neuroshare.sourceforge.net/DLLLinks.shtml">http://neuroshare.sourceforge.net/DLLLinks.shtml</a></div></blockquote>
<p>Please note that you need the corresponding DLLs for your
platform (e.g. Linux, 64-bit). If you find yourself in the
situation that there is no DLL for your specific platform
and you are either on a UNIX-like system you can use G-Node’s
very one nswineproxy component to use the Windows 32 bit
DLLs. Please refer to the nswineproxy homepage for more
information:</p>
<blockquote>
<div><a class="reference external" href="https://github.com/G-Node/nswineproxy">https://github.com/G-Node/nswineproxy</a></div></blockquote>
</div>
</div>
<div class="section" id="quickstart">
<h2>Quickstart<a class="headerlink" href="#quickstart" title="Permalink to this headline">¶</a></h2>
<p>Opening a file:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">neuroshare</span> <span class="kn">as</span> <span class="nn">ns</span>
<span class="n">fd</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">File</span> <span class="p">(</span><span class="s">"NeuroshareExample.mcd"</span><span class="p">)</span>
</pre></div>
</div>
<p>Iterate over the entities in the file:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">for</span> <span class="n">entity</span> <span class="ow">in</span> <span class="n">fd</span><span class="o">.</span><span class="n">list_entities</span><span class="p">():</span>
<span class="k">print</span> <span class="n">entity</span><span class="o">.</span><span class="n">label</span><span class="p">,</span> <span class="n">entity</span><span class="o">.</span><span class="n">entity_type</span>
<span class="o">...</span> <span class="n">do</span> <span class="n">something</span> <span class="k">else</span> <span class="k">with</span> <span class="n">entity</span> <span class="o">...</span>
</pre></div>
</div>
<p>Access analog signal data:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">analog1</span> <span class="o">=</span> <span class="n">fd</span><span class="o">.</span><span class="n">entities</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="c">#open analog signal entity</span>
<span class="n">data</span><span class="p">,</span> <span class="n">times</span><span class="p">,</span> <span class="n">count</span> <span class="o">=</span> <span class="n">analog1</span><span class="o">.</span><span class="n">get_data</span><span class="p">()</span> <span class="c">#load data</span>
</pre></div>
</div>
<p>data will contain the raw data, times the timepoints of
each datapoint and count how many datapoints in data are
actually continous.</p>
</div>
<div class="section" id="reporting-bugs-submitting-patches">
<h2>Reporting Bugs & Submitting Patches<a class="headerlink" href="#reporting-bugs-submitting-patches" title="Permalink to this headline">¶</a></h2>
<p>Any bugs can and should be filed to the project’s issue
tracker at github:</p>
<blockquote>
<div><a class="reference external" href="https://github.com/G-Node/python-neuroshare/issues">https://github.com/G-Node/python-neuroshare/issues</a></div></blockquote>
</div>
<div class="section" id="contact-support">
<h2>Contact & Support<a class="headerlink" href="#contact-support" title="Permalink to this headline">¶</a></h2>
<p>Support and discussion of python-neuroshare related questions
happen in the official G-Node IRC channel #gnode on the
freenode IRC network (cf. <a class="reference external" href="http://freenode.net">http://freenode.net</a>).</p>
</div>
</div>
<div class="section" id="user-s-guide">
<h1>User’s Guide<a class="headerlink" href="#user-s-guide" title="Permalink to this headline">¶</a></h1>
<div class="section" id="file-structure-and-entities">
<h2>File structure and Entities<a class="headerlink" href="#file-structure-and-entities" title="Permalink to this headline">¶</a></h2>
<p>Neuroshare provides access to raw data and metadata (such as the sampling rate and creation date) via so called Entities, which groups data of the same type together. The standard defines 4 different entities: Events, Analog signals, Segments and Neural entities (i.e. spiketrains):</p>
<a class="reference internal image-reference" href="_images/entities.png"><img alt="_images/entities.png" class="align-center" src="_images/entities.png" style="width: 580px;" /></a>
<p>Event entities represent specific timepoints with associated data, e.g. trigger events.</p>
<p>Analog signal entities represents continuously sampled, i.e. digitized, analog data. Examples are waveforms recorded via an electrode (microelectrodes, EKG, EEG).</p>
<p>Segment entities contain cutouts of continuously sampled analog signals from one or more sources that are usually short in time. Most prominent example are waveforms of action potentials from one ore more electrodes.</p>
<p>Neural entities are arrays of timestamps when action potentials happened, i.e. arrays of spike times.</p>
</div>
<div class="section" id="data-access">
<h2>Data access<a class="headerlink" href="#data-access" title="Permalink to this headline">¶</a></h2>
<p>All entities in the file are accessed by their entity index. Each individual entity can have one or more data entries attached to it; these are indetified by a sequential index.</p>
<a class="reference internal image-reference" href="_images/data_schema.png"><img alt="_images/data_schema.png" class="align-center" src="_images/data_schema.png" style="width: 580px;" /></a>
</div>
<div class="section" id="api">
<h2>API<a class="headerlink" href="#api" title="Permalink to this headline">¶</a></h2>
<p>The basic desgin of the API closely follows the Neuroshare entity model. For all 4 entities there is a class that represents that entity:</p>
<ul class="simple">
<li><a class="reference internal" href="#neuroshare.EventEntity" title="neuroshare.EventEntity"><tt class="xref py py-class docutils literal"><span class="pre">EventEntity</span></tt></a> for Events</li>
<li><a class="reference internal" href="#neuroshare.AnalogEntity" title="neuroshare.AnalogEntity"><tt class="xref py py-class docutils literal"><span class="pre">AnalogEntity</span></tt></a> for Analog signal entities</li>
<li><a class="reference internal" href="#neuroshare.SegmentEntity" title="neuroshare.SegmentEntity"><tt class="xref py py-class docutils literal"><span class="pre">SegmentEntity</span></tt></a> for Segements</li>
<li><a class="reference internal" href="#neuroshare.NeuralEntity" title="neuroshare.NeuralEntity"><tt class="xref py py-class docutils literal"><span class="pre">NeuralEntity</span></tt></a> for Neural entities</li>
</ul>
<p>All entity classes derive from a common <a class="reference internal" href="#neuroshare.Entity" title="neuroshare.Entity"><tt class="xref py py-class docutils literal"><span class="pre">Entity</span></tt></a> class that provides metadata common to all entites such as the label (<a class="reference internal" href="#neuroshare.Entity.label" title="neuroshare.Entity.label"><tt class="xref py py-func docutils literal"><span class="pre">Entity.label()</span></tt></a>) and how many data entries are contained in the entity (<a class="reference internal" href="#neuroshare.Entity.item_count" title="neuroshare.Entity.item_count"><tt class="xref py py-func docutils literal"><span class="pre">Entity.item_count()</span></tt></a> or just <tt class="docutils literal"><span class="pre">len(entity)</span></tt>).</p>
<p>Opening a file is simply done by creating a <a class="reference internal" href="#neuroshare.File" title="neuroshare.File"><tt class="xref py py-class docutils literal"><span class="pre">neuroshare.File</span></tt></a> object with the path to the datafile as constructor argument: <tt class="docutils literal"><span class="pre">fd</span> <span class="pre">=</span> <span class="pre">neuroshare.File('data.mcd')</span></tt>. Individual enitities can be accessed via the <a class="reference internal" href="#neuroshare.File.get_entity" title="neuroshare.File.get_entity"><tt class="xref py py-func docutils literal"><span class="pre">File.get_entity()</span></tt></a> function or via indexing through the <a class="reference internal" href="#neuroshare.File.entities" title="neuroshare.File.entities"><tt class="xref py py-func docutils literal"><span class="pre">File.entities()</span></tt></a> property (e.g. <tt class="docutils literal"><span class="pre">File.entities[idx]</span></tt>).</p>
<p>Data is accessed via the <tt class="docutils literal"><span class="pre">get_data()</span></tt> function that all 4 entities provide. Consult the documentation of the individual functions for details.</p>
</div>
<div class="section" id="code-examples">
<h2>Code Examples<a class="headerlink" href="#code-examples" title="Permalink to this headline">¶</a></h2>
<div class="section" id="list-entities-in-a-file">
<h3>List entities in a file<a class="headerlink" href="#list-entities-in-a-file" title="Permalink to this headline">¶</a></h3>
<p>How to list all entities in a file called <cite>data.mcd</cite>:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">neuroshare</span> <span class="kn">as</span> <span class="nn">ns</span>
<span class="n">fd</span> <span class="o">=</span> <span class="n">ns</span><span class="o">.</span><span class="n">File</span><span class="p">(</span><span class="s">'data.mcd'</span><span class="p">)</span>
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">entity</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">fd</span><span class="o">.</span><span class="n">entities</span><span class="p">):</span>
<span class="k">print</span><span class="p">(</span><span class="s">'</span><span class="si">%04d</span><span class="s">: "</span><span class="si">%s</span><span class="s">" type: </span><span class="si">%d</span><span class="s">'</span> <span class="o">%</span> <span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">entity</span><span class="o">.</span><span class="n">label</span><span class="p">,</span> <span class="n">entity</span><span class="o">.</span><span class="n">entity_type</span><span class="p">))</span>
</pre></div>
</div>
<p>This will produces the following output:</p>
<div class="highlight-python"><div class="highlight"><pre>0000: "trig0001 0000 0000 trig0001" type: 1
0001: "elec0001 0000 0000 01" type: 2
0002: "elec0001 0001 0001 02" type: 2
0003: "elec0001 0002 0002 03" type: 2
[...]
</pre></div>
</div>
</div>
<div class="section" id="access-the-raw-data-inside-an-analog-signal-entity">
<h3>Access the raw data inside an analog signal entity<a class="headerlink" href="#access-the-raw-data-inside-an-analog-signal-entity" title="Permalink to this headline">¶</a></h3>
<p>To access the data and timestamps of an analog entity the <a class="reference internal" href="#neuroshare.AnalogEntity.get_data" title="neuroshare.AnalogEntity.get_data"><tt class="xref py py-func docutils literal"><span class="pre">AnalogEntity.get_data()</span></tt></a> is used:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">analog1</span> <span class="o">=</span> <span class="n">fd</span><span class="o">.</span><span class="n">entities</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="c">#access the entity 1</span>
<span class="c">#now load all the raw data</span>
<span class="n">data</span><span class="p">,</span> <span class="n">timestamps</span><span class="p">,</span> <span class="n">cont_count</span> <span class="o">=</span> <span class="n">analog1</span><span class="o">.</span><span class="n">get_data</span><span class="p">()</span>
</pre></div>
</div>
<p>The <tt class="docutils literal"><span class="pre">data</span></tt> value is a <tt class="docutils literal"><span class="pre">3-tuple</span></tt> which contains the raw data and the timestamps for each datapoint.
It is also possible to retrieve a subset of the available data:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">data</span> <span class="o">=</span> <span class="n">analog1</span><span class="o">.</span><span class="n">get_data</span><span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span> <span class="c">#fetch 10 elements starting at index 20</span>
<span class="k">print</span><span class="p">(</span><span class="s">"</span><span class="si">%d</span><span class="s">"</span> <span class="o">%</span> <span class="n">data</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">shape</span><span class="p">)</span>
<span class="c"># -> 10</span>
<span class="k">print</span> <span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
<span class="c"># -></span>
<span class="c"># [ 8.50000000e-05 7.00000000e-05 2.16666667e-05 3.16666667e-05</span>
<span class="c"># 3.66666667e-05 0.00000000e+00 -5.50000000e-05 -9.33333333e-05</span>
<span class="c"># -6.66666667e-05 3.33333333e-06]</span>
</pre></div>
</div>
</div>
<div class="section" id="metadata">
<h3>Metadata<a class="headerlink" href="#metadata" title="Permalink to this headline">¶</a></h3>
<p>Metadata is exposed as python properties of the individual entities:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">print</span><span class="p">(</span><span class="n">analog1</span><span class="o">.</span><span class="n">units</span><span class="p">)</span>
<span class="c"># -> 'V'</span>
<span class="k">print</span><span class="p">(</span><span class="n">analog1</span><span class="o">.</span><span class="n">sample_rate</span><span class="p">)</span>
<span class="c"># -> 25000.0</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="section" id="api-reference">
<h1>API Reference<a class="headerlink" href="#api-reference" title="Permalink to this headline">¶</a></h1>
<div class="section" id="file">
<h2>File<a class="headerlink" href="#file" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="neuroshare.File">
<em class="property">class </em><tt class="descclassname">neuroshare.</tt><tt class="descname">File</tt><big>(</big><em>filename</em>, <em>library=None</em><big>)</big><a class="headerlink" href="#neuroshare.File" title="Permalink to this definition">¶</a></dt>
<dd><p>Object that represents a datafile that can be open via neuroshare at
the location given by <tt class="docutils literal"><span class="pre">filename</span></tt>. The file will be opened upon object
construction.</p>
<p>Individual entities can be opened via the <a class="reference internal" href="#neuroshare.File.get_entity" title="neuroshare.File.get_entity"><tt class="xref py py-func docutils literal"><span class="pre">get_entity()</span></tt></a> function or
the <a class="reference internal" href="#neuroshare.File.entities" title="neuroshare.File.entities"><tt class="xref py py-func docutils literal"><span class="pre">entities()</span></tt></a> property. NB: The first entity index is <strong>0</strong></p>
<dl class="attribute">
<dt id="neuroshare.File.app_name">
<tt class="descname">app_name</tt><a class="headerlink" href="#neuroshare.File.app_name" title="Permalink to this definition">¶</a></dt>
<dd><p>The name of the application that created the file</p>
</dd></dl>
<dl class="method">
<dt id="neuroshare.File.close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#neuroshare.File.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Close the file.</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.File.comment">
<tt class="descname">comment</tt><a class="headerlink" href="#neuroshare.File.comment" title="Permalink to this definition">¶</a></dt>
<dd><p>Additional comments</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.File.ctime">
<tt class="descname">ctime</tt><a class="headerlink" href="#neuroshare.File.ctime" title="Permalink to this definition">¶</a></dt>
<dd><p>The time when this file was created, i.e. the data recorded.
Returns a <tt class="xref py py-class docutils literal"><span class="pre">datetime.datetime</span></tt> object.</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.File.entities">
<tt class="descname">entities</tt><a class="headerlink" href="#neuroshare.File.entities" title="Permalink to this definition">¶</a></dt>
<dd><p>Property that returns a proxy object to allow the opening of
entities in a via indexing, ie:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">entity</span> <span class="o">=</span> <span class="n">datafile</span><span class="o">.</span><span class="n">entities</span><span class="p">[</span><span class="mi">10</span><span class="p">]</span> <span class="c">#retrieve the entity with at 10</span>
</pre></div>
</div>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.File.entity_count">
<tt class="descname">entity_count</tt><a class="headerlink" href="#neuroshare.File.entity_count" title="Permalink to this definition">¶</a></dt>
<dd><p>The number of entities in this file</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.File.file_type">
<tt class="descname">file_type</tt><a class="headerlink" href="#neuroshare.File.file_type" title="Permalink to this definition">¶</a></dt>
<dd><p>Text description of the file type</p>
</dd></dl>
<dl class="method">
<dt id="neuroshare.File.get_entity">
<tt class="descname">get_entity</tt><big>(</big><em>entity_id</em><big>)</big><a class="headerlink" href="#neuroshare.File.get_entity" title="Permalink to this definition">¶</a></dt>
<dd><p>Open the entity at the given index.</p>
</dd></dl>
<dl class="method">
<dt id="neuroshare.File.list_entities">
<tt class="descname">list_entities</tt><big>(</big><em>start=0</em>, <em>end=-1</em><big>)</big><a class="headerlink" href="#neuroshare.File.list_entities" title="Permalink to this definition">¶</a></dt>
<dd><p>List all entities. The range can be limited
via the <tt class="docutils literal"><span class="pre">start</span></tt> and <tt class="docutils literal"><span class="pre">end</span></tt> parameters.</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.File.time_span">
<tt class="descname">time_span</tt><a class="headerlink" href="#neuroshare.File.time_span" title="Permalink to this definition">¶</a></dt>
<dd><p>Timespan of the data in the file [in seconds]</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.File.time_stamp_resolution">
<tt class="descname">time_stamp_resolution</tt><a class="headerlink" href="#neuroshare.File.time_stamp_resolution" title="Permalink to this definition">¶</a></dt>
<dd><p>Minimum resolution of timestamps [in seconds]</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="entity">
<h2>Entity<a class="headerlink" href="#entity" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="neuroshare.Entity">
<em class="property">class </em><tt class="descclassname">neuroshare.</tt><tt class="descname">Entity</tt><big>(</big><em>entity_id</em>, <em>nsfile</em>, <em>entity_info</em><big>)</big><a class="headerlink" href="#neuroshare.Entity" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class of all entities that are contained in a neuroshare file</p>
<dl class="attribute">
<dt id="neuroshare.Entity.entity_type">
<tt class="descname">entity_type</tt><a class="headerlink" href="#neuroshare.Entity.entity_type" title="Permalink to this definition">¶</a></dt>
<dd><p>The type of the entity (of EntityType)</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.Entity.file">
<tt class="descname">file</tt><a class="headerlink" href="#neuroshare.Entity.file" title="Permalink to this definition">¶</a></dt>
<dd><p>The underlying data file of this entity</p>
</dd></dl>
<dl class="method">
<dt id="neuroshare.Entity.get_index_by_time">
<tt class="descname">get_index_by_time</tt><big>(</big><em>timepoint</em>, <em>position=0</em><big>)</big><a class="headerlink" href="#neuroshare.Entity.get_index_by_time" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert from a given timestamp to the corresponding index.
The position argument controls how the timestamp is matched to the index.
Options are:</p>
<ul class="simple">
<li>before and inclusive of the timepoint (<tt class="docutils literal"><span class="pre">EntityTime.Before</span></tt>)</li>
<li>after and inclusive of the timepoint (<tt class="docutils literal"><span class="pre">EntityTime.After</span></tt>)</li>
<li>closest to timepoint (<tt class="docutils literal"><span class="pre">EntityTime.Closest</span></tt>) [default]</li>
</ul>
</dd></dl>
<dl class="method">
<dt id="neuroshare.Entity.get_time_by_index">
<tt class="descname">get_time_by_index</tt><big>(</big><em>index</em><big>)</big><a class="headerlink" href="#neuroshare.Entity.get_time_by_index" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert from a given index to the corresponding timestamp</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.Entity.id">
<tt class="descname">id</tt><a class="headerlink" href="#neuroshare.Entity.id" title="Permalink to this definition">¶</a></dt>
<dd><p>The entity id of this entity</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.Entity.item_count">
<tt class="descname">item_count</tt><a class="headerlink" href="#neuroshare.Entity.item_count" title="Permalink to this definition">¶</a></dt>
<dd><p>Number of data items for the specified entity in the file</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.Entity.label">
<tt class="descname">label</tt><a class="headerlink" href="#neuroshare.Entity.label" title="Permalink to this definition">¶</a></dt>
<dd><p>The label or name of the entity</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="event-entity">
<h2>Event Entity<a class="headerlink" href="#event-entity" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="neuroshare.EventEntity">
<em class="property">class </em><tt class="descclassname">neuroshare.</tt><tt class="descname">EventEntity</tt><big>(</big><em>nsfile</em>, <em>eid</em>, <em>info</em><big>)</big><a class="headerlink" href="#neuroshare.EventEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>Event entities represent specific timepoints with associated data,
e.g. trigger events. Data can be binary (8, 16 or 32 bit) values, text
or comma separated values (cvs).</p>
<dl class="attribute">
<dt id="neuroshare.EventEntity.csv_desc">
<tt class="descname">csv_desc</tt><a class="headerlink" href="#neuroshare.EventEntity.csv_desc" title="Permalink to this definition">¶</a></dt>
<dd><p>Description of the csv fields</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.EventEntity.event_type">
<tt class="descname">event_type</tt><a class="headerlink" href="#neuroshare.EventEntity.event_type" title="Permalink to this definition">¶</a></dt>
<dd><p>The type of the event:</p>
<ul class="simple">
<li>binary (8, 16, 32 bit) [<tt class="docutils literal"><span class="pre">EVENT_BYTE,</span> <span class="pre">EVENT_WORD,</span> <span class="pre">EVENT_DWORD</span></tt>]</li>
<li>text [<tt class="docutils literal"><span class="pre">EVENT_TEXT</span></tt>]</li>
<li>comma separated values (csv) [<tt class="docutils literal"><span class="pre">EVENT_CSV</span></tt>]</li>
</ul>
</dd></dl>
<dl class="method">
<dt id="neuroshare.EventEntity.get_data">
<tt class="descname">get_data</tt><big>(</big><em>index</em><big>)</big><a class="headerlink" href="#neuroshare.EventEntity.get_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve the data at <tt class="docutils literal"><span class="pre">index</span></tt>. Returns a 2-tuple with the
timestamp of the data at the first position (<tt class="docutils literal"><span class="pre">[0]</span></tt>) and the
actual data a the second position (<tt class="docutils literal"><span class="pre">[1]</span></tt>)).
Example use: <tt class="docutils literal"><span class="pre">timestamp,</span> <span class="pre">data</span> <span class="pre">=</span> <span class="pre">event.get_data(0)</span></tt></p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.EventEntity.max_data_length">
<tt class="descname">max_data_length</tt><a class="headerlink" href="#neuroshare.EventEntity.max_data_length" title="Permalink to this definition">¶</a></dt>
<dd><p>Maximum length of the data for the event [in bytes]</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.EventEntity.min_data_length">
<tt class="descname">min_data_length</tt><a class="headerlink" href="#neuroshare.EventEntity.min_data_length" title="Permalink to this definition">¶</a></dt>
<dd><p>Minimum length of the data for the event [in bytes]</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="analog-entity">
<h2>Analog Entity<a class="headerlink" href="#analog-entity" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="neuroshare.AnalogEntity">
<em class="property">class </em><tt class="descclassname">neuroshare.</tt><tt class="descname">AnalogEntity</tt><big>(</big><em>nsfile</em>, <em>eid</em>, <em>info</em><big>)</big><a class="headerlink" href="#neuroshare.AnalogEntity" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#neuroshare.Entity" title="neuroshare.Entity"><tt class="xref py py-class docutils literal"><span class="pre">Entity</span></tt></a> that represents continuously sampled, i.e. digitized, analog data.
Examples are waveforms recorded via an electrode (microelectrodes, EKG, EEG).
Actual data can be accessed via the <a class="reference internal" href="#neuroshare.AnalogEntity.get_data" title="neuroshare.AnalogEntity.get_data"><tt class="xref py py-func docutils literal"><span class="pre">get_data()</span></tt></a> function.
.. note:: data may contain gaps (e.g. when no data is recorded between trails)</p>
<dl class="method">
<dt id="neuroshare.AnalogEntity.get_data">
<tt class="descname">get_data</tt><big>(</big><em>index=0</em>, <em>count=-1</em><big>)</big><a class="headerlink" href="#neuroshare.AnalogEntity.get_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve raw data from file starting at <tt class="docutils literal"><span class="pre">index</span></tt> up to <tt class="docutils literal"><span class="pre">count</span></tt> elements.
If no parameters are given retrieves all available data.</p>
<p>Returns a tuple with three elements containing the raw data <tt class="docutils literal"><span class="pre">[0]</span></tt>, the timestamp
of each data point <tt class="docutils literal"><span class="pre">[1]</span></tt> and how many of the data values are continuous <tt class="docutils literal"><span class="pre">[2]</span></tt>.
Example use: <tt class="docutils literal"><span class="pre">data,</span> <span class="pre">times,</span> <span class="pre">count</span> <span class="pre">=</span> <span class="pre">analog1.get_data()</span></tt></p>
<p>Raw data and timestamp data are return as <tt class="xref py py-class docutils literal"><span class="pre">numpy.ndarray</span></tt>.</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.AnalogEntity.high_filter_type">
<tt class="descname">high_filter_type</tt><a class="headerlink" href="#neuroshare.AnalogEntity.high_filter_type" title="Permalink to this definition">¶</a></dt>
<dd><p>Type of the filter used [text]</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.AnalogEntity.high_freq_corner">
<tt class="descname">high_freq_corner</tt><a class="headerlink" href="#neuroshare.AnalogEntity.high_freq_corner" title="Permalink to this definition">¶</a></dt>
<dd><p>High frequency cutoff [in Hz] of the filter</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.AnalogEntity.high_freq_order">
<tt class="descname">high_freq_order</tt><a class="headerlink" href="#neuroshare.AnalogEntity.high_freq_order" title="Permalink to this definition">¶</a></dt>
<dd><p>Order of the high frequency filter</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.AnalogEntity.location_user">
<tt class="descname">location_user</tt><a class="headerlink" href="#neuroshare.AnalogEntity.location_user" title="Permalink to this definition">¶</a></dt>
<dd><p>Hardware specific additional location information</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.AnalogEntity.location_x">
<tt class="descname">location_x</tt><a class="headerlink" href="#neuroshare.AnalogEntity.location_x" title="Permalink to this definition">¶</a></dt>
<dd><p>x coordinate of the source [in meters]</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.AnalogEntity.location_y">
<tt class="descname">location_y</tt><a class="headerlink" href="#neuroshare.AnalogEntity.location_y" title="Permalink to this definition">¶</a></dt>
<dd><p>y coordinate of the source [in meters]</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.AnalogEntity.location_z">
<tt class="descname">location_z</tt><a class="headerlink" href="#neuroshare.AnalogEntity.location_z" title="Permalink to this definition">¶</a></dt>
<dd><p>z coordinate of the source [in meters]</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.AnalogEntity.low_filter_type">
<tt class="descname">low_filter_type</tt><a class="headerlink" href="#neuroshare.AnalogEntity.low_filter_type" title="Permalink to this definition">¶</a></dt>
<dd><p>Type of the filter used [text]</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.AnalogEntity.low_freq_corner">
<tt class="descname">low_freq_corner</tt><a class="headerlink" href="#neuroshare.AnalogEntity.low_freq_corner" title="Permalink to this definition">¶</a></dt>
<dd><p>Low frequency cutoff [in Hz] of the filter</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.AnalogEntity.low_freq_order">
<tt class="descname">low_freq_order</tt><a class="headerlink" href="#neuroshare.AnalogEntity.low_freq_order" title="Permalink to this definition">¶</a></dt>
<dd><p>Order of the high frequency filter</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.AnalogEntity.max_value">
<tt class="descname">max_value</tt><a class="headerlink" href="#neuroshare.AnalogEntity.max_value" title="Permalink to this definition">¶</a></dt>
<dd><p>Maximum value of the data</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.AnalogEntity.min_value">
<tt class="descname">min_value</tt><a class="headerlink" href="#neuroshare.AnalogEntity.min_value" title="Permalink to this definition">¶</a></dt>
<dd><p>Minimum value of the data</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.AnalogEntity.probe_info">
<tt class="descname">probe_info</tt><a class="headerlink" href="#neuroshare.AnalogEntity.probe_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Additional information</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.AnalogEntity.resolution">
<tt class="descname">resolution</tt><a class="headerlink" href="#neuroshare.AnalogEntity.resolution" title="Permalink to this definition">¶</a></dt>
<dd><p>Minimal resolvable step size</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.AnalogEntity.sample_rate">
<tt class="descname">sample_rate</tt><a class="headerlink" href="#neuroshare.AnalogEntity.sample_rate" title="Permalink to this definition">¶</a></dt>
<dd><p>Sampling rate (in Hz).</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.AnalogEntity.units">
<tt class="descname">units</tt><a class="headerlink" href="#neuroshare.AnalogEntity.units" title="Permalink to this definition">¶</a></dt>
<dd><p>Physical units of measured data</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="neural-entity">
<h2>Neural Entity<a class="headerlink" href="#neural-entity" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="neuroshare.NeuralEntity">
<em class="property">class </em><tt class="descclassname">neuroshare.</tt><tt class="descname">NeuralEntity</tt><big>(</big><em>nsfile</em>, <em>eid</em>, <em>info</em><big>)</big><a class="headerlink" href="#neuroshare.NeuralEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>Entity the represents timestamps of action potentials, i.e. spike times.
Cutouts of the waveforms corresponding to spike data in a neural entity
might be found in a separate <a class="reference internal" href="#neuroshare.SegmentEntity" title="neuroshare.SegmentEntity"><tt class="xref py py-class docutils literal"><span class="pre">SegmentEntity</span></tt></a> (cf. <a class="reference internal" href="#neuroshare.NeuralEntity.source_entity_id" title="neuroshare.NeuralEntity.source_entity_id"><tt class="xref py py-func docutils literal"><span class="pre">source_entity_id()</span></tt></a>).</p>
<dl class="method">
<dt id="neuroshare.NeuralEntity.get_data">
<tt class="descname">get_data</tt><big>(</big><em>index=0</em>, <em>count=-1</em><big>)</big><a class="headerlink" href="#neuroshare.NeuralEntity.get_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve the spike times associated with this entity. A subset
of the data can be requested via the <tt class="docutils literal"><span class="pre">index</span></tt> and <tt class="docutils literal"><span class="pre">count</span></tt>
parameters.</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.NeuralEntity.probe_info">
<tt class="descname">probe_info</tt><a class="headerlink" href="#neuroshare.NeuralEntity.probe_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Additional information about the signal source</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.NeuralEntity.source_entity_id">
<tt class="descname">source_entity_id</tt><a class="headerlink" href="#neuroshare.NeuralEntity.source_entity_id" title="Permalink to this definition">¶</a></dt>
<dd><p>[<em>Optional</em>] Id of the source entity of this spike, if any.
For example the spike waveform of the action potential corresponding
to this spike might have been recorded in a segment entity.</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.NeuralEntity.source_unit_id">
<tt class="descname">source_unit_id</tt><a class="headerlink" href="#neuroshare.NeuralEntity.source_unit_id" title="Permalink to this definition">¶</a></dt>
<dd><p>[<em>Optional</em>] unit id used in the source entity
(cf. <a class="reference internal" href="#neuroshare.NeuralEntity.source_entity_id" title="neuroshare.NeuralEntity.source_entity_id"><tt class="xref py py-func docutils literal"><span class="pre">source_entity_id()</span></tt></a>)</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="segment-entity">
<h2>Segment Entity<a class="headerlink" href="#segment-entity" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="neuroshare.SegmentEntity">
<em class="property">class </em><tt class="descclassname">neuroshare.</tt><tt class="descname">SegmentEntity</tt><big>(</big><em>nsfile</em>, <em>eid</em>, <em>info</em><big>)</big><a class="headerlink" href="#neuroshare.SegmentEntity" title="Permalink to this definition">¶</a></dt>
<dd><p>Segment entities contain cutouts of continuously sampled analog signals from
one or more sources that are usually short in time. Most prominent example are
waveforms of action potentials from one ore more electrodes.</p>
<dl class="method">
<dt id="neuroshare.SegmentEntity.get_data">
<tt class="descname">get_data</tt><big>(</big><em>index</em><big>)</big><a class="headerlink" href="#neuroshare.SegmentEntity.get_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve the data at <tt class="docutils literal"><span class="pre">index</span></tt></p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.SegmentEntity.max_sample_count">
<tt class="descname">max_sample_count</tt><a class="headerlink" href="#neuroshare.SegmentEntity.max_sample_count" title="Permalink to this definition">¶</a></dt>
<dd><p>Maximum number of samples in each data item</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.SegmentEntity.source_count">
<tt class="descname">source_count</tt><a class="headerlink" href="#neuroshare.SegmentEntity.source_count" title="Permalink to this definition">¶</a></dt>
<dd><p>Number of sources for this segment entity.</p>
</dd></dl>
<dl class="attribute">
<dt id="neuroshare.SegmentEntity.sources">
<tt class="descname">sources</tt><a class="headerlink" href="#neuroshare.SegmentEntity.sources" title="Permalink to this definition">¶</a></dt>
<dd><p>Property that provides access to the metadata of the individual
sources of this entity.</p>
<p>Returns a sequence of objects of type <tt class="xref py py-class docutils literal"><span class="pre">SegmentSource</span></tt>.
Metadata properties of a SegmentSource are analogous to the
<a class="reference internal" href="#neuroshare.AnalogEntity" title="neuroshare.AnalogEntity"><tt class="xref py py-class docutils literal"><span class="pre">AnalogEntity</span></tt></a>.</p>
</dd></dl>
</dd></dl>
</div>
</div>
<div class="section" id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
<ul class="simple">
<li><a class="reference internal" href="genindex.html"><em>Index</em></a></li>
<li><a class="reference internal" href="py-modindex.html"><em>Module Index</em></a></li>
<li><a class="reference internal" href="search.html"><em>Search Page</em></a></li>
</ul>
<p><em>(c) 2013 Christian Kellner and the German Neuroinformatics Node</em></p>
<a class="reference external image-reference" href="http://www.g-node.org"><img alt="_images/gnode_logo.png" class="align-center" src="_images/gnode_logo.png" style="width: 200px;" /></a>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<a href="http://github.com/G-Node/python-neuroshare"><img style="position: fixed; top: 0; right: 0; border: 0;"
src="http://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a>
</div>
</body>
</html>
|