|
| 1 | +<h1> {{title}} </h1> |
| 2 | + |
| 3 | +{{#overview}} |
| 4 | + |
| 5 | +<p>In this example, we will explore the {{{hub}}}'s functionality by demoing its capabilities. The workflow below can by copy/pasted into the Bonsai editor using the clipboard icon in the top right. This workflow:</p> |
| 6 | + |
| 7 | +<ul> |
| 8 | + {{#workflowFunctions}} |
| 9 | + <li>{{{.}}}</li> |
| 10 | + {{/workflowFunctions}} |
| 11 | +</ul> |
| 12 | + |
| 13 | +<div class="workflow"> |
| 14 | + <p><img src="../workflows/examples/{{{hubSnakeCase}}}.bonsai" alt="{{{hub}}} Workflow"></p> |
| 15 | +</div> |
| 16 | + |
| 17 | +<div class="TIP alert alert-info"> |
| 18 | + <h5>TIP</h5> |
| 19 | + <p>If you want a less busy starting point for using the {{{hub}}} then have a look at the <a class="xref" href="../articles/hubs/{{{hubSnakeCase}}}.html">{{{operator}}}</a> in the user guide.</p> |
| 20 | +</div> |
| 21 | + |
| 22 | +{{/overview}} |
| 23 | + |
| 24 | +{{#configure}} |
| 25 | + |
| 26 | +<h2> Configuring the {{{hub}}} </h2> |
| 27 | + |
| 28 | +<p>We start by configuring the hardware using a configuration chain. This chain creates a hardware context using <a class="xref" href="../api/OpenEphys.Onix1.CreateContext.html">CreateContext</a>, adds a {{{hub}}} configuration using <a class="xref" href="../api/OpenEphys.Onix1.Configure{{{configureOperator}}}.html">{{{configureOperator}}}</a>, and then starts acquisition using <a class="xref" href="../api/OpenEphys.Onix1.StartAcquisition.html">StartAcquisition</a>. Here we break down each of these operators.</p> |
| 29 | + |
| 30 | +<div class="workflow"> |
| 31 | + <p><img src="../workflows/examples/{{{configureOperator}}}.bonsai" alt="{{{configureOperator}}} Workflow"></p> |
| 32 | +</div> |
| 33 | + |
| 34 | +<h3> CreateContext </h3> |
| 35 | + |
| 36 | +<p>The <a class="xref" href="../api/OpenEphys.Onix1.CreateContext.html">CreateContext</a> operator determines the device driver and host-computer index that the system communicates through. The <code>Driver</code> property is set to "riffa", which is the name of the the PCIe device used by ONIX. In our case, because we are using a single ONIX system, the the <code>Index</code> property is set to 0. If second system was used on the same computer, a second <a class="xref" href="../api/OpenEphys.Onix1.CreateContext.html">CreateContext</a> operator would be required and its <code>Index</code> property set to 1.</p> |
| 37 | + |
| 38 | +<h3> {{{configureOperator}}} </h3> |
| 39 | + |
| 40 | +<p>The <a class="xref" href="../api/OpenEphys.Onix1.Configure{{{configureOperator}}}.html">{{{configureOperator}}}</a> operator is used to configure the {{hub}}. Configuration settings for the {{hub}} can be examined and edited by clicking on the operator to open its property pane to the right of the editor. Expanding the members of the property pane allows you to configure each of the devices contained by the {{hub}}. |
| 41 | +{{#gui}}This {{hub}} has a configuration GUI that can be accessed by following the <a class="xref" href="./{{hubSnakeCase}}-gui-tut.html">{{hub}} GUI Tutorial</a>.{{/gui}} |
| 42 | +{{^nonDefaultProperties}}In this demo, the {{hub}} properties are set to their default values.{{/nonDefaultProperties}} |
| 43 | +{{#nonDefaultProperties}}In this demo, the {{hub}} properties are set to their default values, except:{{/nonDefaultProperties}}</p> |
| 44 | + |
| 45 | +<ul> |
| 46 | + {{#nonDefaultProperties}}<li>{{{.}}}</li>{{/nonDefaultProperties}} |
| 47 | +</ul> |
| 48 | + |
| 49 | +<p>Aside from the configuration operations, the output of the <a class="xref" href="../api/OpenEphys.Onix1.Configure{{{configureOperator}}}.html">{{{configureOperator}}}</a> operator is timestamped and then saved to a CSV file. This file will contain the wall-clock time that data collection start along with metadata concerning important system configuration settings.</p> |
| 50 | + |
| 51 | +<h3> StartAcquisition </h3> |
| 52 | + |
| 53 | +<p>The <a class="xref" href="../api/OpenEphys.Onix1.StartAcquisition.html">StartAcquisition</a> operator begins acquisition after the hardware has been configured. In this example, we are going to be capturing data from the {{{hub}}}. <!---To learn how to decide the ideal <code>ReadBlockSize</code> value, refer to <a class="xref" href="breakoutboard-tut.html#startacquisition">the corresponding section in the Breakout Board Tutorial</a>---><!---<a class="xref">Setting ReadBlockSize Tutorial</a>--->.</p> |
| 54 | + |
| 55 | +{{/configure}} |
| 56 | + |
| 57 | +<h2> Streaming data </h2> |
| 58 | + |
| 59 | +<p>The rest of the workflow concerns capturing data to and from the {{{hub}}}, using a set of discrete "processing graphs" that either produce data from hardware (inputs/sources) or accept data produced by software (outputs/sinks). We describe these graphs in the following sections.</p> |
| 60 | + |
| 61 | +<div class="TIP alert alert-info"> |
| 62 | + <h5>TIP</h5> |
| 63 | + <p>When trying to understand a workflow's operation, its very useful to visualize the data that being generated by each operator. You can open an operator's visualizer by double clicking the node while the workflow is running. The type of visualizer that opens will depend on the type of data handled by the operator and whether or not the appropriate Design library has been installed.</p> |
| 64 | +</div> |
| 65 | + |
| 66 | +{{#dataIOOperators}}{{>partials/tutorials/device}}{{/dataIOOperators}} |
| 67 | + |
| 68 | +<!--- |
| 69 | +<h2>Loading data</h2> |
| 70 | +<p>The following python script can be used to load and plot the data produced by the workflow described in this tutorial.</p> |
| 71 | + |
| 72 | +[!code-python[](../workflows/examples/load-breakoutboard.py)] |
| 73 | + |
| 74 | +<div class="NOTE alert alert-info"> |
| 75 | + <h5>NOTE</h5> |
| 76 | + <p>This script will attempt to load entire files into arrays. For long recordings, data will need to be split into more manageable chunks by:</p> |
| 77 | + <ul> |
| 78 | + <li>Modifying this script to partially load files</li> |
| 79 | + <li>Modifying the workflow to cyclically creating new files after a certain duration</li> |
| 80 | + </ul> |
| 81 | +</div> |
| 82 | +---> |
| 83 | + |
| 84 | + |
0 commit comments