/probe-channel-maps

Utilities for generating mappings between the various channel coordinate systems in the probe channel routing.

Primary LanguageOpenEdge ABL

probe-channel-maps

This repository contains channel maps for the neural probes used with Willow.

For the Impatient

If you have a Willow dataset, and just want to know which channel maps to which location on the probe, go into that probe's subdirectory, grab the appropriate "level2" pickle file (.p), and load it into Python. The "appropriate" level2 file is the one which corresponds to the chip-to-connector mapping used to acquire the data. The Level 2 pickle file will give you a dictionary whose keys are (shank, row, col), and whose values are the Willow channels as they're ordered in the Willow HDF5 data files. For example, in Python:

>>> import pickle
>>> probeMap = pickle.load(open('256chan_P3/probeMap_256_P3_level2_canonical.p', 'rb'))
>>> willowChan = probeMap[0,26,1] # shank 0, row 26, column 1
>>> print willowChan
149

Using this repo

Each probe type has a dedicated subdirectory (e.g. 256chan_P3) which contains both its Level 1 and Level 2 mappings. What's the difference?

  • Level 1 mappings go from probe geometry (shank, row, column) up to connectors and pins on the probe PCB. In the language defined below, they go from pad coordinates up to connector coordinates.
  • Level 2 mappings go from probe geometry up to the channel numbering used in the Willow software and data files. In the language defined below, they go from pad coordinates up to Willow coordinates.

Level 2 mappings are generated using the Level 1 mappings, plus a chip-to-connector map which represents the headstage-to-probe connection scheme. Thus Level 2 mappings are always in reference to a connection scheme. To make this robust, the chip-to-connector map is stored as in the Level 2 mappings as a dictionary value under the key "chip2conn".

The Level 1 mappings are intrinsic to the probe and its packaging. They are generated by various methods using various pieces of information; the details for generating Level 1 mappings are outside the scope of this repo.

Mappings are implemented as Python dictionaries stored in pickle files (.p).

For a diagrammatic overview of the definitions of the coordinate systems, see summary.svg.

ProbeMapUtils.py contains some useful utilities:

generate_level2_mapping() generates a Level 2 mapping from a Level 1 mapping, and a chip-to-connector map.

print_chip2conn() prints out the chip-to-connector map in human-readable form.

generate_text_file_level1() generates a text file from a Level 1 mapping.

generate_text_file_level2() generates a text file from a Level 2 mapping.

Definitions

In the past, many coordinate systems have been used for describing Willow channels at various levels of description. Here we define and promulgate four coordinate systems which we believe will minimize confusion, encourage consistency, and respect the modularity boundaries that are relevant to both the users and developers of the system.

Some conventions to keep in mind:

  • left/right and up/down is always in reference to the system being viewed as in summary.svg: with headstages on top, and the probe on the bottom, pointing downward
  • Integer values are zero-indexed, and their range is indicated using open/closed set notation (e.g. willowChan in [0,1023] means 0 to 1023 inclusive)
  • Row-major ordering of 2D arrays (e.g. connector arrays)

Willow Coordinates: willowChan

The Willow coordinate system is the channel numbering used by the Willow datanode and software once the data has been digitized by the Intan chips. It is a linear enumeration consisting of a single integer:

  • willowChan, in [0,1023]. willowChan ranges in [0,127] on headstage 0, [128,255] on headstage 1, etc., regardless of which headstages are actually plugged in.

Chip Coordinates: (chip, ffcTrace)

Chip coordinates describe which Intan chip the channel is on, as well as which trace on that chip's FFC cable the channel corresponds to.

  • the chip number, in [0,31], increases from left to right, on and across headstages. Note that chip = willowChan mod 32
  • the ffcTrace number, in [0,32], refers to the trace (instead of a pad) on an FFC cable, starting from 0 on the left and increasing to the right when the cable is help vertically with the pads facing up. Note that trace 16, which is the reference trace, is excluded from the channel numbering system.

Connector Coordinates: (conn, ffcTrace)

Connector coordinates describe channels in the context of the FFC connectors on the probe PCB. Connector coordinates consist of two values:

  • the conn (connector) number, which starts at zero and increments in row-major order (like how english is written) across the FFC connectors on a probe.
  • the ffcTrace number, defined exactly as it is in chip coordinates above

Pad Coordinates: (shank, row, col)

Pad coordinates describe the recording site (or pad) on the probe, to which the channel maps. It is the "lowest" level of description in this mapping system. Pad coordinates consist of three values:

  • the shank number, starting at zero and incrementing from left to right
  • the row number, starting at zero and increasing from top to bottom
  • the col (column) number, starting at zero and increasing from left to right