Below is a collection of simple conversion scripts that are all tested against small proprietary examples files. They are all optimized to handle very large data by iteratively steping through large files and read/writing them one piece at a time. They also leverage lossless compression within HDF5, which allows you to make large datasets smaller without losing any data. We have seen this reduce large datasets by up to 66%!
Extracellular electrophysiology
For extracellular electrophysiology, we use the SpikeExtractors repository from the [SpikeInterface](http://spikeinterface.readthedocs.io/) project. To install this package, run
$ pip install spikeextractors
All of the format listed below are tested against example dataset in the ephy_testing_data GIN repository maintained by the NEO team.
Recording
Blackrock
from spikeextractors import NwbRecordingExtractor, BlackrockRecordingExtractor rx = BlackrockRecordingExtractor("dataset_path") NwbRecordingExtractor.write_recording(rx, "output_path.nwb")Intan
from spikeextractors import NwbRecordingExtractor, IntanRecordingExtractor rx = IntanRecordingExtractor("intan_rhd_test_1.rhd") NwbRecordingExtractor.write_recording(rx, "output_path.nwb")MEArec
from spikeextractors import NwbRecordingExtractor, MEArecRecordingExtractor rx = MEArecRecordingExtractor("mearec_test_10s.h5") NwbRecordingExtractor.write_recording(rx, "output_path.nwb")Neuralynx
from spikeextractors import NwbRecordingExtractor, NeuralynxRecordingExtractor rx = NeuralynxRecordingExtractor("data_directory") NwbRecordingExtractor.write_recording(rx, "output_path.nwb")Neuroscope
from spikeextractors import NwbRecordingExtractor, NeuroscopeRecordingExtractor rx = NeuroscopeRecordingExtractor("data_file.dat") NwbRecordingExtractor.write_recording(rx, "output_path.nwb")OpenEphys (legacy)
from spikeextractors import NwbRecordingExtractor, OpenEphysRecordingExtractor rx = OpenEphysRecordingExtractor("data_folder") NwbRecordingExtractor.write_recording(rx, "output_path.nwb")OpenEphys binary (Neuropixels)
from spikeextractors import NwbRecordingExtractor, OpenEphysNPIXRecordingExtractor rx = OpenEphysNPIXRecordingExtractor("folder_path") NwbRecordingExtractor.write_recording(rx, "output_path.nwb")Phy
from spikeextractors import NwbRecordingExtractor, PhyRecordingExtractor rx = PhyRecordingExtractor("folder_path") NwbRecordingExtractor.write_recording(rx, "output_path.nwb")SpikeGLX
from spikeextractors import NwbRecordingExtractor, SpikeGLXRecordingExtractor rx = SpikeGLXRecordingExtractor("MySession_g0_t0.imec0.ap.bin") NwbRecordingExtractor.write_recording(rx, "output_path.nwb")Sorting
Blackrock
from spikeextractors import NwbSortingExtractor, BlackrockSortingExtractor rx = BlackrockSortingExtractor("filename") NwbSortingExtractor.write_sorting(rx, "output_path.nwb")Klusta
from spikeextractors import NwbSortingExtractor, KlustaSortingExtractor rx = KlustaSortingExtractor("neo.kwik") NwbSortingExtractor.write_sorting(rx, "output_path.nwb")MEArec
from spikeextractors import NwbSortingExtractor, MEArecSortingExtractor rx = MEArecSortingExtractor("mearec_test_10s.h5") NwbSortingExtractor.write_sorting(rx, "output_path.nwb")Phy
from spikeextractors import NwbSortingExtractor, PhySortingExtractor rx = PhySortingExtractor("data_folder") NwbSortingExtractor.write_sorting(rx, "output_path.nwb")Plexon
from spikeextractors import NwbSortingExtractor, rx = ("File_plexon_2.plx") NwbSortingExtractor.write_sorting(rx, "output_path.nwb")Spyking Circus
from spikeextractors import NwbSortingExtractor, rx = ("file_or_folder_path") NwbSortingExtractor.write_sorting(rx, "output_path.nwb")
Optical physiology
For optical physiology, we use the [RoiExtractors](https://roiextractors.readthedocs.io/en/latest/) library developed by [CatalystNeuro](catalystneuro.com). To install, run
$ pip install roiextractors
All formats listed in the optical physiology section are tested against the ophys_testing_data GIN repository.
Imaging
Tiff
from roiextractors import NwbImagingExtractor, TiffImagingExtractor imaging_ex = TiffImagingExtractor("imaging.tiff") NwbImagingExtractor.write_imaging(imaging_ex, "output_path.nwb")Hdf5
from roiextractors import NwbImagingExtractor, Hdf5ImagingExtractor imaging_ex = Hdf5ImagingExtractor("Movie.hdf5") NwbImagingExtractor.write_imaging(imaging_ex, "output_path.nwb")SBX
from roiextractors import NwbImagingExtractor, SbxImagingExtractor imaging_ex = SbxImagingExtractor("scanbox_file.mat") NwbImagingExtractor.write_imaging(imaging_ex, "output_path.nwb")Segmentation
CaImAn
from roiextractors import NwbSegmentationExtractor, CaimanSegmentationExtractor seg_ex = CaimanSegmentationExtractor("caiman_analysis.hdf5") NwbSegmentationExtractor.write_segmentation(seg_ex, "output_path.nwb")Suite2p
from roiextractors import NwbSegmentationExtractor, Suite2pSegmentationExtractor seg_ex = Suite2pSegmentationExtractor("segmentation_datasets/suite2p") NwbSegmentationExtractor.write_segmentation(seg_ex, "output_path.nwb")
That is awesome