Skip to main content

An NWB:N extension for storing bipolar referencing schema

Project description

ndx-bipolar-referencing Extension for NWB:N

Structure for storing the bipolar schema of a recording in an NWB file.

schema schema

python installation

$ pip install ndx-bipolar-referencing

python usage

from pynwb import NWBHDF5IO, NWBFile
from pynwb.file import DynamicTable, DynamicTableRegion
from datetime import datetime
from ndx_bipolar_referencing import EcephysExt
from pynwb.ecephys import ElectricalSeries

import numpy as np

nwbfile = NWBFile('description', 'id', datetime.now().astimezone())

device = nwbfile.create_device('device_name')

electrode_group = nwbfile.create_electrode_group('electrode_group',
                                                 'desc', 'loc', device=device)

for _ in range(20):
    nwbfile.add_electrode(np.nan, np.nan, np.nan, np.nan, 'loc', 'filt',
                          electrode_group)

positive_electrodes = DynamicTableRegion('positive_electrodes',
                                         np.arange(0, 20, 2),
                                         'desc',
                                         nwbfile.electrodes)
negative_electrodes = DynamicTableRegion('negative_electrodes',
                                         np.arange(1, 20, 2),
                                         'desc',
                                         nwbfile.electrodes)

bipolar_reference_scheme = DynamicTable(name='bipolar_reference_scheme',
                                        description='desc',
                                        columns=[positive_electrodes,
                                                 negative_electrodes])

ecephys_ext = EcephysExt(bipolar_reference_scheme=bipolar_reference_scheme)
nwbfile.add_lab_meta_data(ecephys_ext)

bipolar_scheme = DynamicTableRegion(
    name='electrodes',
    data=np.arange(0, 10),
    description='desc',
    table=nwbfile.lab_meta_data['extracellular_electrophysiology_extensions'].bipolar_reference_scheme)

ec_series = ElectricalSeries(name='test_ec_series',
                             description='desc',
                             data=np.random.rand(100, 10),
                             rate=1000.,
                             electrodes=bipolar_scheme)

nwbfile.add_acquisition(ec_series)

with NWBHDF5IO('test_nwb.nwb', 'w') as io:
    io.write(nwbfile)

with NWBHDF5IO('test_nwb.nwb', 'r', load_namespaces=True) as io:
    nwbfile = io.read()
    print(nwbfile.acquisition['test_ec_series'].electrodes.table['positive_electrodes'].data)

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-bipolar-referencing-0.1.1.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

ndx_bipolar_referencing-0.1.1-py2.py3-none-any.whl (5.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ndx-bipolar-referencing-0.1.1.tar.gz.

File metadata

  • Download URL: ndx-bipolar-referencing-0.1.1.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for ndx-bipolar-referencing-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9c6ef494efd42e5fa1383c6607d9b9aea0a05f4a9df97557d69209f9644103ff
MD5 f2e141c58142fe2219c0d674157332ea
BLAKE2b-256 7165c557b063ca948a92cbcadcb7ef0285df524ff23f6d0f7b2a27ddb6a88184

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ndx_bipolar_referencing-0.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for ndx_bipolar_referencing-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5fee89fa0934e96d4b729b5c520983a7af272941d7c37277106142ec6d248974
MD5 efd26d4bb9c8c2de739b86f17d5c70aa
BLAKE2b-256 f1ba106f6399e11c9fbb4427186df05149c346443d8666377bf60d5c6caa7026

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