Loading...

Record

Record

Commands

Use the commands below to configure, start, or stop your device.

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

# start recording
synapsectl -u $DEVICE_IP start

#OR

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

# stop recording
synapsectl -u $DEVICE_IP stop

Configure

Before you can record with your SciFi device, you must configure a signal chain with a JSON file. This file defines the nodes used in your signal chain and the configration of those individual nodes. It can also define your Axon channel and GPIO configurations for devices that support these.

Configure an Axon Channel

If you are using a Science Axon device powered by a Nixel 512 chip, you must include id, electrode_id, and reference_id fields in your configuration JSON.

  • 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.

Configure Axon GPIOs

If you are using external event inputs to peripheral Axon devices, you must specify the GPIO type flag in the channel inputs of your configuration JSON. 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 to ensure sub-millisecond synchronization precision.

Example Configuration

This basic example has two nodes: one ingests data from a source and the other writes the data to disk.

The kBroadbandSource node ingests 16 channels of neural data and two channels of GPIO data from an Axon Omnetics adapter ("peripheral_id": 100) at a sampling rate of 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.

The kBroadbandSource node passes all data to the kDiskWriter node, which writes the data to device storage under the name "YourData" in HDF5 format.

{
  "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": 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 chip.

Save Data

Neural data can either be saved on device using the DiskWriter node or saved to a client computer running synapsectl using Taps.

The DiskWriter node saves data to the on-device directory specified in the configuration JSON used. If the same directory name is used for multiple recordings, each subsequent recording directory will be appended numerically.

SciFi data directories cannot be accessed via USB. Instead, you can download on-device data via WiFi using the synapsectl file command. The first time you access a SciFi device, you will be prompted to enter the password found at Settings > Device Info > DiskWriter Pass.

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 $DEVICE_IP file get -r disk_writer/$YOUR_DATA_FILENAME

Use Taps to Save 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

You can use the Synapse API command line interface to control your SciFi headstage and client functions. Use synapsectl -h or --help to output a list of the available commands.

$ synapsectl --help

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

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,apps,settings}
    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 Broadband Tap and save to HDF5
    plot                Plot recorded synapse data
    file                File commands
    taps                Interact with taps on the network
    apps                Manage applications on a Synapse device
    settings            Manage the persistent device settings

Synapse Apps

Synapse Apps are fully customizable, standalone applications deployed directly to your Synapse device. By running custom neural processing algorithms on-device within the signal chain, you can drastically minimize latency. Apps read data from upstream nodes and can output it either to downstream nodes or to your local client via WiFi using Taps. Because Taps can be placed anywhere within an app or at a node's output, you choose where to put the radio. You can even stream from multiple Taps simultaneously.

You can learn moreabout building and deploying Synapse Apps using the example app detailed in the Synapse App API or visiting Synapse App SDK overview for more information about app development.

Measure Impedance

First, you must construct an impedance query JSON to send to your SciFi device. This example queries electrodes 1–5, but you can query as many electrode IDs as you would like.

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

Then, send the query JSON to the device and it will start measuring the impedance. The command may take a few minutes if your list of electrode IDs is large.

synapsectl -u $DEVICE_IP query $QUERY_JSON_PATH

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
  }
}