Loading...

Record

Record

Device Configuration

To record with SciFi, you will need to first specify the nodes in your recording configuration using a Synapse JSON file.

Signal chains can be arranged in linear or branching configurations, and each node in the chain has its own configuration settings. For example, the kBroadbandSource node ingests n channels of broadband data at a specified sampling rate and bit depth, and input source is identified by peripheral_id.

Axon Channel Configuration

Axon devices are powered using the Nixel 512 chip, which amplifies and digitized neural data from an array of 512 electrode contacts arranged into 256 differential record channels. When creating your .json configuration file, id, electrode_id, and reference_id are required fields.

  • electrode_id is the channel id as specified by the Nixel chip.
  • id is the arbitrarily-defined channel id specified by the Axon device
  • reference_id specifies the reference mode used for a given channel.

See the Axon Omnetics adapter pinout for a practical example showing the difference between electrode_id and id.

Axon GPIO Configuration

External event inputs to peripheral Axon devices are specified using the GPIO type flag when specifying your channel inputs in the configuration JSON file. Axon GPIOs support TTL signaling with a maximum input voltage of +5V, and a HIGH/LOW threshold of +1.5V. GPIO channels are recorded alongside neural data channels from the same Axon adapter using the same sampling rate. This ensures sub-millisecond synchronization precision.

Currently, Axon GPIOs are input only and are only available on the Axon Omnetics adapter.

Example Configuration

The configuration example below shows a basic setup where a kBroadbandSource node ("src_node_id": 1) ingests 32 channels of neural data and two channels of GPIO data from an Axon Omnetics adapter ("peripheral_id": 100). All channels from this source are sampled at 32 kHz. The neural data channels ("type": "ELECTRODE") are acquired using 12 bit width and are filtered using the specified high- and low-pass filter corner frequencies (high_cutoff_hz and low_cutoff_hz, respectively). GPIO channels ("type": "GPIO") ignore bit depth and bandpass filter settings.

All data is sent to the destination node ("dst_node_id": 2), where it is saved on-device under the designated filename ("filename": "YourData") using the kDiskWriter node. This data is saved in HDF5 format. Broadband source data can also be simultaneously streamed out over wifi to your client computer running synapse-python using Taps.

{
  "nodes": [
    {
      "type": "kDiskWriter",
      "id": 2,
      "disk_writer": {
      "filename": "YourData"
      }
    },
    {
      "type": "kBroadbandSource",
      "id": 1,
      "broadband_source": {
        "peripheral_id": 100,
        "sample_rate_hz": 32000,
        "bit_width": 12,
        "signal": {
          "electrode": {
            "channels": [
              {"id": 0, "electrode_id": 122, "reference_id": 520, "type": "ELECTRODE"}, {"id": 4, "electrode_id": 110, "reference_id": 520}, {"id": 5, "electrode_id": 114, "reference_id": 520}, {"id": 6, "electrode_id": 104, "reference_id": 520}, {"id": 7, "electrode_id": 108, "reference_id": 520}, {"id": 8, "electrode_id": 98, "reference_id": 520}, {"id": 9, "electrode_id": 66, "reference_id": 520}, {"id": 10, "electrode_id": 92, "reference_id": 520},
              {"id": 1, "electrode_id": 126, "reference_id": 520, "type": "ELECTRODE"}, {"id": 11, "electrode_id": 60, "reference_id": 520}, {"id": 12, "electrode_id": 86, "reference_id": 520}, {"id": 13, "electrode_id": 54, "reference_id": 520}, {"id": 14, "electrode_id": 80, "reference_id": 520}, {"id": 15, "electrode_id": 48, "reference_id": 520}, {"id": 16, "electrode_id": 74, "reference_id": 520}, {"id": 17, "electrode_id": 38, "reference_id": 520},
              {"id": 2, "electrode_id": 116, "reference_id": 520, "type": "ELECTRODE"}, {"id": 18, "electrode_id": 68, "reference_id": 520}, {"id": 19, "electrode_id": 36, "reference_id": 520}, {"id": 20, "electrode_id": 62, "reference_id": 520}, {"id": 21, "electrode_id": 0, "reference_id": 520}, {"id": 22, "electrode_id": 56, "reference_id": 520}, {"id": 23, "electrode_id": 4, "reference_id": 520}, {"id": 24, "electrode_id": 50, "reference_id": 520},
              {"id": 3, "electrode_id": 120, "reference_id": 520, "type": "ELECTRODE"}, {"id": 25, "electrode_id": 12, "reference_id": 520}, {"id": 26, "electrode_id": 44, "reference_id": 520}, {"id": 27, "electrode_id": 14, "reference_id": 520}, {"id": 28, "electrode_id": 42, "reference_id": 520}, {"id": 29, "electrode_id": 20, "reference_id": 520}, {"id": 30, "electrode_id": 32, "reference_id": 520}, {"id": 31, "electrode_id": 26, "reference_id": 520}],
              {"id": 32, "electrode_id": 0, "type": "GPIO"}
              {"id": 33, "electrode_id": 1, "type": "GPIO"}
            ],
            "low_cutoff_hz": 4,
            "high_cutoff_hz": 20400
          }
        }
      }
    }
  ],
  "connections": [
    {
      "src_node_id": 1,
      "dst_node_id": 2
    }
  ]
}

Note: ELECTRODE is the default type setting for broadband source channel data and is therefore optional for electrode inputs from Axon devices. It is included for illustrative purposes in the configuration shown above.

Please refer to the Synapse peripheral documentation for a complete list of configuration options for Axon devices using the Nixel 512.

Save SciFi Data

SciFi data can either be saved on device using the DiskWriter node or saved to a client computer running synapsectl using Taps. Data from each DiskWriter node is saved to its own directory on-device using the name specified in the configuration file used. If the same configuration file or DiskWriter filename is used for multiple recordings, each subsequent recording directory will be appended numerically.

Data saved to on-board storage is password protected and can be downloaded via wifi the file command in synapsectl. The available file commands can be viewed using -h. SciFi data directories cannot be accessed via USB.

The first time you access a SciFi device you will be prompted to enter a password, which can be found by navigating to Settings > Device Info > DiskWriter Pass. After, you will be asked if you would like to save the password for this device.

The example below shows the expected output when accessing SciFi data using synapsectl:

synapsectl -u 10.40.63.217 file ls disk_writer/

Listing directory: disk_writer/


| Permissions |  Size  | Date modified |   Filename   |
|-------------|--------|---------------|--------------|
│ drwxrwxr-x  │ 4.0 kB │ Apr 22 15:27  │ Data/│ drwxrwxr-x  │ 4.0 kB │ Apr 22 15:32  │ Data_1/│ drwxrwxr-x  │ 4.0 kB │ Apr 22 16:29  │ Data_2/

You can download your saved data to local storage using using the get command as shown below:

synapsectl -u "name" file get -r disk_writer/$YOUR_DATA_FILENAME

Save Streaming Taps Data

SciFi data can be saved to a local client running synapsectl using Taps. This is done by streaming and saving data from a specified tap in the signal chain using the read command. Importantly, data streamed to the client using read requires you to specify a configuration file with the optional --output command.

Synapse API

The Synapse API command line interface (CLI) synapsectl is used to control the SciFi headstage, and also controls client functions such as build and deployment of Synapse Apps to SciFi. The -h or --help option can be used to output a list of the available synapsectl commands.

$ synapsectl --help

usage: synapsectl [-h] [--uri URI] [--version] [--verbose]
                  {discover,info,query,start,stop,configure,logs,read,plot,file,taps,deploy,build} ...

Synapse Device Manager

options:
  -h, --help            show this help message and exit
  --uri URI, -u URI     The device identifier to connect to. Can either be the IP address or name
  --version             show program's version number and exit
  --verbose, -v         Enable verbose output

Commands:
  {discover,info,query,start,stop,configure,logs,read,plot,file,taps,deploy,build}
    discover            Discover Synapse devices on the network
    info                Get device information
    query               Execute a query on the device
    start               Start the device or an application
    stop                Stop the device or an application
    configure           Write a configuration to the device
    logs                Get logs from the device
    read                Read from a device's StreamOut node
    plot                Plot recorded synapse data
    file                File commands
    taps                Interact with taps on the network
    deploy              Deploy an application to a Synapse device
    build               Cross-compile and package an application into a .deb without deploying

Synapse Apps

Synapse Apps are fully customizable standalone applications that can be deployed to your Synapse device. Apps allow you to run your custom neural processing algorithms on-device within a node in the signal chain to minimize latency. They read in data from other nodes in the signal chain, and output data to downstream connected nodes or over wifi using Taps. Taps can be placed within an app, or at the node output, letting you choose where to put the radio. Apps also support streaming from multiple taps simultaneously, enabling simultaneous multi-source streaming to a local client running synapsectl.

You can familiarize yourself with the process of building and deploying Synapse Apps with the synapse-example-app detailed in the Synapse App API or visit Synapse App SDK overview for more information about app development.

Synapse Commands

While SciFi can be used in a traditional manner to simply record data to disk with the start and stop commands, the Synapse signal chain supports a wide array of functions that may or may not include saving data to disk. As such, the start command can be thought of as initiating dataflow through the signal chain. This data can be saved to disk using the DiskWriter node as shown in the example configuration file above.

For information about streaming data from SciFi, visit Taps API.

Start and Stop Dataflow

A signal chain configuration file must be sent to your SciFi before a start command can be sent. These can be sent separately, or in a single command as shown below:

# configure your device signal chain
synapsectl -u $DEVICE_IP configure $PATH_TO_CONFIG.json

# send the start command
synapsectl -u $DEVICE_IP start

#OR

# send your configuration and the start command together
synapsectl -u $DEVICE_IP start $PATH_TO_CONFIG.json

You can stop your device and/or app using the stop command as shown below:

synapsectl -u $DEVICE_IP stop

You can use the info command to view your device status. This will tell you information about signal chain and app configuration as well as whether or not the device is currently running.

synapsectl -u $DEVICE_IP info

Measure Impedance

Query Construction

In order to request an impedance measurement from a Synapse device, you will need to construct and format an “Impedance Query” message to send to the SciFi in the form of a JSON file:

{
  "query_type": "kImpedance",
  "impedance_query": {
    "electrode_ids": [1, 2, 3, 4, 5]
  }
}

Your list of electrode IDs can be as long as you’d like.

Run the Test

Use the following command to begin the measurement:

synapsectl -u $DEVICE_IP query $QUERY_JSON_PATH

The command may take a few minutes if your list of electrode IDs is large.

After the measurement finishes, a Synapse status message output is generated (typically blank) and a list of each electrode measurement by magnitude (Ohms) and phase (degrees). The output file is saved in a CSV format and titled impedance_measurements_$DATE_$TIMESTAMP.csv.

status {
}
impedance_response {
  measurements {
    electrode_id: 1
    magnitude: 13414576.0
    phase: -210.17554
  }
  measurements {
    electrode_id: 2
    magnitude: 28159914.0
    phase: -184.9782
  }
  measurements {
    electrode_id: 3
    magnitude: 12796945.0
    phase: -168.97946
  }
  measurements {
    electrode_id: 4
    magnitude: 31529048.0
    phase: -248.70753
  }
  measurements {
    electrode_id: 5
    magnitude: 1768543.4
    phase: -147.09204
  }
}