Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Apr 2, 2024
1 parent d3c991b commit e34ebd2
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
19 changes: 18 additions & 1 deletion User-Manual/Plugins/Ephys-Socket.html
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ <h2>Header Format for Custom Data Streams<a class="headerlink" href="#header-for
<td><p>Total number of bytes sent in each packet. Calculated as <code class="code docutils literal notranslate"><span class="pre">num_bytes</span> <span class="pre">=</span> <span class="pre">num_channels</span> <span class="pre">*</span> <span class="pre">num_samples</span> <span class="pre">*</span> <span class="pre">element_size</span></code>. This does <strong>not</strong> include the header bytes.</p></td>
</tr>
<tr class="row-even"><td><p>Bit Depth</p></td>
<td><p>int16</p></td>
<td><p><cite>int16</cite></p></td>
<td><p>Depth defines the OpenCV.Mat <a class="reference external" href="https://github.com/horizongir/opencv.net/blob/main/src/OpenCV.Net/CoreTypes.cs#L93">Depth</a>, an enumeration defined as <code class="code docutils literal notranslate"><span class="pre">[U8,</span> <span class="pre">S8,</span> <span class="pre">U16,</span> <span class="pre">S16,</span> <span class="pre">S32,</span> <span class="pre">F32,</span> <span class="pre">F64]</span></code>, where U is ‘unsigned’, S is ‘signed’, F is ‘float’, and the number indicates the number of bits. For example, <code class="code docutils literal notranslate"><span class="pre">U16</span></code> means ‘unsigned integer with 16 bits’. Note that the enumeration is zero-indexed, where <code class="code docutils literal notranslate"><span class="pre">U8</span> <span class="pre">=</span> <span class="pre">0</span></code>, and <code class="code docutils literal notranslate"><span class="pre">F64</span> <span class="pre">=</span> <span class="pre">6</span></code></p></td>
</tr>
<tr class="row-odd"><td><p>Element Size</p></td>
Expand All @@ -627,6 +627,22 @@ <h2>Header Format for Custom Data Streams<a class="headerlink" href="#header-for
<p>Pay attention to the order of data samples in the example script. Samples are not interleaved, but rather in each packet the samples for channel 1 are sent, followed by the samples for channel 2, and so on.</p>
</div>
</section>
<section id="remote-control">
<h2>Remote Control<a class="headerlink" href="#remote-control" title="Permalink to this heading">#</a></h2>
<p>Some Ephys Socket settings can be modified via the GUI’s built-in HTTP server. Commands are sent as “config messages” to the Ephys Socket node.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Parameters cannot be modified while acquisition is running, nor can they be modified if the port is connected. To change any settings remotely, the port must be disconnected in the GUI</p>
</div>
<p>The following commands are available:</p>
<ol class="arabic simple">
<li><p><code class="code docutils literal notranslate"><span class="pre">ES</span> <span class="pre">INFO</span></code> : returns a JSON string containing information about all available variables (i.e., scale, offset, port, and frequency)</p></li>
<li><p><code class="code docutils literal notranslate"><span class="pre">ES</span> <span class="pre">SCALE</span> <span class="pre">&lt;data_scale&gt;</span></code> : set the data scale</p></li>
<li><p><code class="code docutils literal notranslate"><span class="pre">ES</span> <span class="pre">OFFSET</span> <span class="pre">&lt;data_offset&gt;</span></code> : set the data offset</p></li>
<li><p><code class="code docutils literal notranslate"><span class="pre">ES</span> <span class="pre">PORT</span> <span class="pre">&lt;port&gt;</span></code> : set the port number</p></li>
<li><p><code class="code docutils literal notranslate"><span class="pre">ES</span> <span class="pre">FREQUENCY</span> <span class="pre">&lt;sample_rate&gt;</span></code> : set the sampling frequency</p></li>
</ol>
</section>
</section>


Expand Down Expand Up @@ -683,6 +699,7 @@ <h2>Header Format for Custom Data Streams<a class="headerlink" href="#header-for
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#header-format-for-custom-data-streams">Header Format for Custom Data Streams</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#remote-control">Remote Control</a></li>
</ul>
</nav></div>

Expand Down
19 changes: 18 additions & 1 deletion _sources/User-Manual/Plugins/Ephys-Socket.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,28 @@ An example Python script is included in the `Resources <https://github.com/open-
"**Variable**", "**Data Type**", "**Description**"
"Offset", "`int32`", "Integer defining the offset in the data stream. For TCP sockets, value must always be set to **0**."
"Number of Bytes", "`int32`", "Total number of bytes sent in each packet. Calculated as :code:`num_bytes = num_channels * num_samples * element_size`. This does **not** include the header bytes."
"Bit Depth", "int16", "Depth defines the OpenCV.Mat `Depth <https://github.com/horizongir/opencv.net/blob/main/src/OpenCV.Net/CoreTypes.cs#L93>`__, an enumeration defined as :code:`[U8, S8, U16, S16, S32, F32, F64]`, where U is 'unsigned', S is 'signed', F is 'float', and the number indicates the number of bits. For example, :code:`U16` means 'unsigned integer with 16 bits'. Note that the enumeration is zero-indexed, where :code:`U8 = 0`, and :code:`F64 = 6`"
"Bit Depth", "`int16`", "Depth defines the OpenCV.Mat `Depth <https://github.com/horizongir/opencv.net/blob/main/src/OpenCV.Net/CoreTypes.cs#L93>`__, an enumeration defined as :code:`[U8, S8, U16, S16, S32, F32, F64]`, where U is 'unsigned', S is 'signed', F is 'float', and the number indicates the number of bits. For example, :code:`U16` means 'unsigned integer with 16 bits'. Note that the enumeration is zero-indexed, where :code:`U8 = 0`, and :code:`F64 = 6`"
"Element Size", "`int32`", "Number of bytes needed for each sample. For :code:`U16`, :code:`element_size = 2`, while for :code:`F64`, :code:`element_size = 8`."
"Number of Channels", "`int32`", "Number of channels per packet."
"Number of Samples", "`int32`", "Number of samples sent per channel per packet."

.. note::

Pay attention to the order of data samples in the example script. Samples are not interleaved, but rather in each packet the samples for channel 1 are sent, followed by the samples for channel 2, and so on.

Remote Control
#################

Some Ephys Socket settings can be modified via the GUI's built-in HTTP server. Commands are sent as "config messages" to the Ephys Socket node.

.. note::

Parameters cannot be modified while acquisition is running, nor can they be modified if the port is connected. To change any settings remotely, the port must be disconnected in the GUI

The following commands are available:

1. :code:`ES INFO` : returns a JSON string containing information about all available variables (i.e., scale, offset, port, and frequency)
2. :code:`ES SCALE <data_scale>` : set the data scale
3. :code:`ES OFFSET <data_offset>` : set the data offset
4. :code:`ES PORT <port>` : set the port number
5. :code:`ES FREQUENCY <sample_rate>` : set the sampling frequency
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit e34ebd2

Please sign in to comment.