Skip to content

AllenNeuralDynamics/aind-vr-foraging-primary-data-nwb-packaging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VR Foraging Primary Data NWB Packaging

The capsule can be found here.

This capsule packages VR Foraging Primary Data into NWB following the file standards listed here.

The capsule uses a data contract with relevants paths to raw data to be packaged. Details on the data contract and an example can be found at the following.

The output of this packaging is an nwb file with data in the acquisition module. Most, if not all of the data in the nwb are stored as DynamicTables, a table representation of the various streams from the input data contract. To read the nwb and access the data, the following code snippet can be run - dependencies are hdmf-zarr, and pynwb.

from hdmf_zarr import NWBZarrIO
import json

# REPLACE WITH PATH TO NWB
with NWBZarrIO('path/to/nwb', 'r') as io:
  nwb = io.read()

keys = list(nwb.acquisition.keys())
# access one of streams from acquisition
data = nwb.acquisition[keys[0]]
print(data)
data_df = data[:] # gives a dataframe representation of table

# For fetching json files from the data contract, for now, they are stored in a dynamic table but in the description field. The way to recover it from the nwb is as follows:
json_dict = json.loads(nwb.acquisition[key].description)

The acqusition module in the nwb is structured as follows:

📁 NWBFile: Acqusition Module

This module contains tables from the primary data. Each entry is a DynamicTable that can be accessed with the code snippet above. The tables with json information in the description are Behavior.InputSchemas.Rig, Behavior.InputSchemas.Session, and Behavior.InputSchemas.TaskLogic.

📑 DynamicTables

  • Behavior.HarpBehavior.AnalogData
  • Behavior.HarpBehavior.AssemblyVersion
  • Behavior.HarpBehavior.Camera0Frame
  • Behavior.HarpBehavior.Camera0Frequency
  • Behavior.HarpBehavior.Camera1Frame
  • Behavior.HarpBehavior.Camera1Frequency
  • Behavior.HarpBehavior.ClockConfiguration
  • Behavior.HarpBehavior.CoreVersionHigh
  • ...

About

Capsule that packages primary data for VR Foraging task using data contract

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published