# ndx-whisk Extension for NWB
ndx-whisk is an [NWB](https://www.nwb.org/) extension to store whisker tracking measurements. It is intended to convert `.whiskers` and `.measurements` files generated by [whisk (Janelia Whisker Tracker)](https://github.com/nclack/whisk/), or saved to `hdf5` with [WhiskiWrap](https://github.com/cxrodgers/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`.
```python
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](https://github.com/nwb-extensions/ndx-template).
Raw data
{
"_id": null,
"home_page": "",
"name": "ndx-whisk",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "NeurodataWithoutBorders,NWB,nwb-extension,ndx-extension",
"author": "Vincent Prevosto",
"author_email": "prevosto@mit.edu",
"download_url": "https://files.pythonhosted.org/packages/b0/35/c116b5030c9e40df0f0aceb7aa84b2bd1512b7cec060e2ae17190fb9baf0/ndx-whisk-0.1.1.tar.gz",
"platform": null,
"description": "# ndx-whisk Extension for NWB\n\nndx-whisk is an [NWB](https://www.nwb.org/) extension to store whisker tracking measurements. It is intended to convert `.whiskers` and `.measurements` files generated by [whisk (Janelia Whisker Tracker)](https://github.com/nclack/whisk/), or saved to `hdf5` with [WhiskiWrap](https://github.com/cxrodgers/WhiskiWrap), but can be used with other whisker tracking methods.\n\n## Installation\n\n`pip install ndx-whisk`\n\n## Usage\n\nSee test script `test_whiskermeasurement.py` in `src/pynwb/tests`. \n\n```python\nfrom pynwb import NWBHDF5IO, NWBFile\nfrom ndx_whisk import WhiskerMeasurementTable\nimport numpy as np\n\n# Load your data\nwhisker_data = read_whisker_measurement_table('tracked_data.whiskers')\n\n# Create a WhiskerMeasurementTable\nwhisker_meas = WhiskerMeasurementTable(\n name='name',\n description='description'\n)\n\n# Add data to the WhiskerMeasurementTable\nfor i in range(np.shape(whisker_data['frame_id'])[0]):\n whisker_meas.add_row({k: whisker_data[k][i] for k in whisker_data.keys()})\n \n# Set up a NWB file\nnwbfile = set_up_nwbfile()\npath = 'tracked_data.nwb'\n\n# Add a ProcessingModule for behavioral data\nbehavior_module = nwbfile.create_processing_module(\n name=\"behavior\", description=\"Processed behavioral data\"\n)\n\n# Add the WhiskerMeasurementTable\nnwbfile.processing['behavior'].add(whisker_meas)\n\n# Save to NWB file\nwith NWBHDF5IO(path, mode='w') as io:\n io.write(nwbfile)\n```\n\n---\nThis extension was created using [ndx-template](https://github.com/nwb-extensions/ndx-template).\n",
"bugtrack_url": null,
"license": "BSD-3",
"summary": "NWB extension to store whisker tracking measurements computed with Whisk (Janelia Whisker Tracker) or other video-based whisker tracking methods.",
"version": "0.1.1",
"project_urls": null,
"split_keywords": [
"neurodatawithoutborders",
"nwb",
"nwb-extension",
"ndx-extension"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4993ff267a622459373433c58b6242b59d105725332067bdfad007a729d0ede3",
"md5": "7309b4c21a4b1f314e1dcc3307bf2f89",
"sha256": "f0eeadc818671076e5d63cddc5ab97a09fc730d4b71f231cc172fd3eac7d6343"
},
"downloads": -1,
"filename": "ndx_whisk-0.1.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "7309b4c21a4b1f314e1dcc3307bf2f89",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 4514,
"upload_time": "2023-08-09T14:33:40",
"upload_time_iso_8601": "2023-08-09T14:33:40.518460Z",
"url": "https://files.pythonhosted.org/packages/49/93/ff267a622459373433c58b6242b59d105725332067bdfad007a729d0ede3/ndx_whisk-0.1.1-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b035c116b5030c9e40df0f0aceb7aa84b2bd1512b7cec060e2ae17190fb9baf0",
"md5": "4848aa32433ab6d6272ea667823d0473",
"sha256": "68bf5c6b2ac7f45de91ee15dfe190bc9098d852d049c9e11ee0071b06689ee2c"
},
"downloads": -1,
"filename": "ndx-whisk-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "4848aa32433ab6d6272ea667823d0473",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10473734,
"upload_time": "2023-08-09T14:33:42",
"upload_time_iso_8601": "2023-08-09T14:33:42.061318Z",
"url": "https://files.pythonhosted.org/packages/b0/35/c116b5030c9e40df0f0aceb7aa84b2bd1512b7cec060e2ae17190fb9baf0/ndx-whisk-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-09 14:33:42",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "ndx-whisk"
}