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:
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.
Behavior.HarpBehavior.AnalogDataBehavior.HarpBehavior.AssemblyVersionBehavior.HarpBehavior.Camera0FrameBehavior.HarpBehavior.Camera0FrequencyBehavior.HarpBehavior.Camera1FrameBehavior.HarpBehavior.Camera1FrequencyBehavior.HarpBehavior.ClockConfigurationBehavior.HarpBehavior.CoreVersionHigh...