Format spec: say whether a probe lists all its contacts, and define device_channel_indices

オープン 初心者向け
#475 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python
領域
documentation

調査の方向性

まず probeinterface.readthedocs.io/en/main/format_spec.html のフォーマット仕様を確認し、その定義を Probe.set_device_channel_indices と Probe.get_slice のAPIドキュメントと比較してください。ファイルがすべてのコンタクトを表すのか、それとも一部を表すのかを明確にし、device_channel_indices の長さと値、および -1 の意味を定義してください。仕様によってissueで説明されている曖昧さが解消されたら完了です。報告者はPRへの協力を申し出ています。

索引モデルが issue の本文から書いたものです。

説明

The format spec (https://probeinterface.readthedocs.io/en/main/format_spec.html) lists contact_positions as necessary and device_channel_indices as optional, but doesn't say what either means for a probe whose recording uses only some of its electrodes. The API docs suggest two different answers:

  • Probe.set_device_channel_indices: "If some channels are not connected or not recorded then channel should be set to "-1"". This implies a probe file describes every contact, and the wiring says which ones were recorded.
  • Probe.get_slice: "a copy of the Probe with a sub selection of contacts". Saved, this gives a file with only the recorded contacts.

Both kinds of file are in circulation, and a reader can't tell them apart from the file. For example, an NP2014 (4 shanks × 1280 electrodes) recorded on 384 channels can be saved as 5120 contacts with device_channel_indices of -1 for the 4736 unrecorded ones, or as 384 contacts. Both carry "model_name": "NP2014". Only knowledge of the part number reveals that the second is a subset, and nothing in it says which electrodes of the full probe the 384 contacts are, other than contact_ids by convention.

This matters to software that uses a probe file to configure hardware or to show the whole probe, rather than only to sort spikes. Open Ephys's Bonsai.Onix1 loads Neuropixels probe files as full probes and rejects the cut-down form, since there the geometry is fixed and the selection changes between recordings.

Suggestions, in order of preference:

  1. State in the spec that a probe describes all of its contacts, and that device_channel_indices gives each contact's channel on the acquisition device, or -1 for a contact not recorded. get_slice stays as an in-memory operation, and writing a sliced probe is documented as producing a file that describes a subset.
  2. Failing that, mark a subset in the file, for example a probe-level annotation such as "contact_subset": true, and define contact_ids as the reference into the full probe from the catalog, so a reader can rebuild the full probe.
  3. In either case, define device_channel_indices in the spec itself: its length, its value range, and what -1 means.

Happy to help with a PR to the spec text.

主要言語
Python
スター
89
フォーク
52
平均マージ
1日 19時間
マージ済み PR(30日)
4

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

SpikeInterface/probeinterface のほかの issue

SpikeInterface/probeinterface の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。