Skip to main content

NWB extension to store whisker tracking measurements computed with Whisk (Janelia Whisker Tracker) or other video-based whisker tracking methods.

Project description

ndx-whisk Extension for NWB

ndx-whisk is an NWB extension to store whisker tracking measurements. It is intended to convert .whiskers and .measurements files generated by whisk (Janelia Whisker Tracker), or saved to hdf5 with WhiskiWrap, but can be used with other whisker tracking methods.

Installation

pip install ndx-whisk

Usage

See test script test_whiskermeasurement.py in src/pynwb/tests.

from pynwb import NWBHDF5IO, NWBFile
from ndx_whisk import WhiskerMeasurementTable
import numpy as np

# Load your data
whisker_data = read_whisker_measurement_table('tracked_data.whiskers')

# Create a WhiskerMeasurementTable
whisker_meas = WhiskerMeasurementTable(
    name='name',
    description='description'
)

# Add data to the WhiskerMeasurementTable
for i in range(np.shape(whisker_data['frame_id'])[0]):
    whisker_meas.add_row({k: whisker_data[k][i] for k in whisker_data.keys()})
    
# Set up a NWB file
nwbfile = set_up_nwbfile()
path = 'tracked_data.nwb'

# Add a ProcessingModule for behavioral data
behavior_module = nwbfile.create_processing_module(
    name="behavior", description="Processed behavioral data"
)

# Add the WhiskerMeasurementTable
nwbfile.processing['behavior'].add(whisker_meas)

# Save to NWB file
with NWBHDF5IO(path, mode='w') as io:
    io.write(nwbfile)

This extension was created using ndx-template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ndx-whisk-0.1.1.tar.gz (10.5 MB view details)

Uploaded Source

Built Distribution

ndx_whisk-0.1.1-py2.py3-none-any.whl (4.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ndx-whisk-0.1.1.tar.gz.

File metadata

  • Download URL: ndx-whisk-0.1.1.tar.gz
  • Upload date:
  • Size: 10.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for ndx-whisk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 68bf5c6b2ac7f45de91ee15dfe190bc9098d852d049c9e11ee0071b06689ee2c
MD5 4848aa32433ab6d6272ea667823d0473
BLAKE2b-256 b035c116b5030c9e40df0f0aceb7aa84b2bd1512b7cec060e2ae17190fb9baf0

See more details on using hashes here.

File details

Details for the file ndx_whisk-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: ndx_whisk-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for ndx_whisk-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f0eeadc818671076e5d63cddc5ab97a09fc730d4b71f231cc172fd3eac7d6343
MD5 7309b4c21a4b1f314e1dcc3307bf2f89
BLAKE2b-256 4993ff267a622459373433c58b6242b59d105725332067bdfad007a729d0ede3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page