Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pynwb | |
from pynwb.spec import NWBDatasetSpec, NWBGroupSpec, NWBNamespace | |
from hdmf.spec import NamespaceCatalog | |
from hdmf.build import TypeMap | |
def print_namespace_versions(type_map): | |
"""Print the namespace name and version of all namespaces in the given type map.""" | |
for ns_name in type_map.namespace_catalog.namespaces: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pynwb import NWBHDF5IO | |
import pynwb | |
from hdmf.data_utils import GenericDataChunkIterator | |
from hdmf.backends.hdf5.h5_utils import H5DataIO | |
filepath = r"D:\GiocomoData_dandiset53\000053\sub-npI1\sub-npI1_ses-20190413_behavior+ecephys.nwb" | |
class H5DatasetDataChunkIterator(GenericDataChunkIterator): | |
"""A data chunk iterator that reads chunks over the 0th dimension of an HDF5 dataset up to a max length. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pynwb import NWBFile, NWBHDF5IO | |
from pynwb.ecephys import LFP, ElectricalSeries | |
import numpy as np | |
import datetime | |
# Create a test file | |
nwb = NWBFile( | |
session_description='session_description', | |
identifier='identifier', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import numpy as np | |
from pynwb import NWBFile, NWBHDF5IO, validate | |
nwbfile = NWBFile( | |
session_description='session_description', | |
identifier='identifier', | |
session_start_time=datetime.datetime.now(datetime.timezone.utc), | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pynwb | |
import ndx_franklab_novela | |
with pynwb.NWBHDF5IO('beans20190718.nwb', 'r') as io: | |
nwbfile = io.read() | |
orig_eseries = nwbfile.acquisition['e-series'] | |
n_timestamps = 4000000 # / 20000 Hz sampling rate = 200 seconds | |
data = orig_eseries.data[0:n_timestamps, :] | |
ts = orig_eseries.timestamps[0:n_timestamps] | |
electrodes = nwbfile.create_electrode_table_region( |
NewerOlder