Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Establish full Bpod ingestion

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
python

調査の方向性

element_trial/readers/Bpod.py から始め、SciPy の loadmat アプローチを使用してフィールドを調査し、現在の reader を issue に記載された 6 つの Bpod .mat の例と比較します。どのデータを一貫して取り込めるか、また trials の再構築に RawEvents が必要かどうかを判断します。利用可能なすべての例に対して element_interface に組み込める、完全に開発された reader の準備が整えば完了です。

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

説明

enhancement

MATLAB is the only environment officially supported by Bpod developers. SciPy has a lot of support for loading mat files. In the current draft, SciPy is used to import Bpod .mat files as embedded dictionaries. Micheal Wulf shared the Bpod files that are currently available via djarchive as workflow-trial, revision 0.0.0b1. They were shared as a diverse set of examples. Under element_trial/readers/, there is a reader draft in need of further development, Bpod.py, and eventual inclusion in element_interface. It handles general ingestion for fields that are consistent across examples, but there are many differences across files. A fully realized loader may need to pull directly from Bpod 'raw' fields to reconstruct the experiment, as many other fields are organized differently across trials.

Ecosystem: The SanWorks team (git repositories here) offers no offical python support, suggesting instead that users export to JSON. The PyBpod project (github, docs) offers a python-based GUI alternative for running Bpod hardware. So far as I could tell, they do not offer any useful ingestion functions we would want to incorporate.

from workflow_trial.pipeline import subject, session, trial
from workflow_trial.ingest import ingest_subjects, ingest_sessions
ingest_subjects(); _ = ingest_sessions()

# Download from djarchive, set root trial directory in workflow
from djarchive_client import client; c = client()
c.download('workflow-trial', '0.0.0b1', '<local-path>', create_target=True)
def get_trial_root_dir(): # also defined in workflow_trial.paths
    return '<local-path>'

# List of files
bpods_filepath=[
    "Bpod_Behavior_Data/BalbC_Ph_W1_LH_Randdelay_changeover_Aug08_2021_Session1.mat",
    "Bpod_Behavior_Data/1119A_3_LoomingThreat_Dec26_2019_Session1.mat",
    "Bpod_Behavior_Data_and_TrialEvents/NeuroPixels/TQ03_Dual2AFC_Jun18_2021_Session1.mat",
    "Bpod_Behavior_Data_and_TrialEvents/NeuroPixels/TrialEvents.mat",
    "Bpod_Behavior_Data_and_TrialEvents/Neuralynx/TP24_Dual2AFC_Feb12_2019_Session1.mat",
    "Bpod_Behavior_Data_and_TrialEvents/Neuralynx/TrialEvents.mat"]

import scipy.io as spio
def load_bpod_matfile(matlab_filepath):
    """Loading routine for behavioral file, bpod .mat """
    SessionData = spio.loadmat(matlab_filepath.as_posix(),
                               squeeze_me=True,simplify_cells=True,
                               struct_as_record=False)['SessionData']
    return SessionData # functionally a dictionary

# See how files differ
for f in bpods_filepath:
    filepath = find_full_path(get_trial_root_dir(),f)
    print(str(filepath).split("/")[-1])
    data = load_bpod_matfile(filepath)
    try: print(data['RawEvents']['Trial'][0]) # replace with other fields
    except KeyError: pass
主要言語
Python
スター
2
フォーク
18
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

datajoint/element-event のほかの issue

datajoint/element-event の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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