.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/ex_11_automatic_wiring.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_ex_11_automatic_wiring.py: Automatic wiring ---------------- Here is an example on how to handle the wiring automatically and to get the device_channel_indices. .. GENERATED FROM PYTHON SOURCE LINES 9-17 .. code-block:: Python from pprint import pprint import numpy as np import matplotlib.pyplot as plt from probeinterface import Probe, get_probe from probeinterface.plotting import plot_probe .. GENERATED FROM PYTHON SOURCE LINES 18-19 Download one probe: .. GENERATED FROM PYTHON SOURCE LINES 19-26 .. code-block:: Python manufacturer = 'neuronexus' probe_name = 'A1x32-Poly3-10mm-50-177' probe = get_probe(manufacturer, probe_name) print(probe) .. rst-class:: sphx-glr-script-out .. code-block:: none Probe - neuronexus - A1x32-Poly3-10mm-50-177 - 32ch .. GENERATED FROM PYTHON SOURCE LINES 27-36 We can "wire" this probe to a recording device. Imagine we connect this Neuronexus probe with an Omnetic to an Intan RHD headstage. Using the wiring documentation from these two sites: https://www.neuronexus.com/files/wiringconfiguration/Wiring_H32.pdf http://intantech.com/RHD_headstages.html?tabSelect=RHD32ch&yPos=0 After a long headache we can figure out the wiring to the device manually and set it using the `probe.set_device_channel_indices()` function: .. GENERATED FROM PYTHON SOURCE LINES 36-42 .. code-block:: Python device_channel_indices = [ 16, 17, 18, 20, 21, 22, 31, 30, 29, 27, 26, 25, 24, 28, 23, 19, 12, 8, 3, 7, 6, 5, 4, 2, 1, 0, 9, 10, 11, 13, 14, 15] probe.set_device_channel_indices(device_channel_indices) .. GENERATED FROM PYTHON SOURCE LINES 43-49 In order to ease this process, `probeinterface` also includes some commonly used wirings based on standard connectors. We created references and spreadsheets showing how these wirings are computed at `probeinterface/resources/wiring_references `_. If we have a Intan RHD2132 Headstage attached to a NeuroNexus H32 Connector, we can import this wiring as follows: .. GENERATED FROM PYTHON SOURCE LINES 49-53 .. code-block:: Python probe.wiring_to_device('H32>RHD2132') print(probe.device_channel_indices) .. rst-class:: sphx-glr-script-out .. code-block:: none [16 17 18 20 21 22 31 30 29 27 26 25 24 28 23 19 12 8 3 7 6 5 4 2 1 0 9 10 11 13 14 15] .. GENERATED FROM PYTHON SOURCE LINES 54-57 In this figure we have 2 numbers for each contact: * the upper number "prbXX" is the contact id (one-based, from NeuroNexus) * the lower "devXX" is the channel on the Intan device (zero-based) .. GENERATED FROM PYTHON SOURCE LINES 57-62 .. code-block:: Python fig, ax = plt.subplots(figsize=(5, 15)) plot_probe(probe, with_contact_id=True, with_device_index=True, ax=ax) .. image-sg:: /examples/images/sphx_glr_ex_11_automatic_wiring_001.png :alt: Probe - neuronexus - A1x32-Poly3-10mm-50-177 - 32ch :srcset: /examples/images/sphx_glr_ex_11_automatic_wiring_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none (, ) .. GENERATED FROM PYTHON SOURCE LINES 63-70 Available wiring "pathways" --------------------------- The available pathways can be found in the `probeinterface.wiring `_ module. The following pathways are available: .. GENERATED FROM PYTHON SOURCE LINES 70-76 .. code-block:: Python from probeinterface import get_available_pathways print(get_available_pathways()) plt.show() .. rst-class:: sphx-glr-script-out .. code-block:: none ['H32>RHD2132', 'ASSY-156>RHD2164', 'ASSY-116>RHD2132', 'ASSY-77>Adpt.A64-Om32_2x-sm-NN>RHD2164', 'ASSY-77>Adpt.A64-Om32_2x-sm-NN>two_RHD2132', 'ASSY-77>Adpt.A64-Om32_2x-sm-cambridgeneurotech>two_RHD2132', 'ASSY-77>Adpt.A64-Om32_2x-sm-cambridgeneurotech>RHD2164', 'cambridgeneurotech_mini-amp-64'] .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.119 seconds) .. _sphx_glr_download_examples_ex_11_automatic_wiring.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: ex_11_automatic_wiring.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: ex_11_automatic_wiring.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: ex_11_automatic_wiring.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_