NWB Conversion Tools is a package for creating NWB files by converting and combining neural data in proprietary formats and adding essential metadata.
Features:
- Command line interface
- Python API
- Qt GUI for customized metadata curation
- Leverages SpikeExtractor to support conversion from a number or proprietary formats.
To install nwb-conversion-tools directly in an existing environment:
$ pip install nwb-conversion-tools
Alternatively, to clone the repository and set up a conda environment, do:
$ git clone https://github.com/NeurodataWithoutBorders/nwb-conversion-tools
$ cd nwb-conversion-tools
$ conda env create -f make_env.yml
$ conda activate nwb_conversion_env
$ pip install .
The Graphic User Interface of nwb-conversion-tools provides an user-friendly way of editing metafiles for the conversion tasks and for exploring nwb files with nwb-jupyter-widgets and an embedded IPython console.
After activating the correct environment, nwb_conversion_tools GUI can be called from command line:
nwb-gui
To initiate the GUI with a specific metafile:
nwb-gui metafile.yml
The GUI can also be imported and run from python scripts:
from nwb_conversion_tools.gui.nwb_conversion_gui import nwb_conversion_gui
# YAML metafile
metafile = 'metafile.yml'
# Conversion module
conversion_module = 'conversion_module.py'
# Source files path
source_paths = {}
source_paths['source_file_1'] = {'type': 'file', 'path': ''}
source_paths['source_file_2'] = {'type': 'file', 'path': ''}
# Other options
kwargs = {'option_1': True, 'option_2': False}
nwb_conversion_gui(
metafile=metafile,
conversion_class=conversion_class,
source_paths=source_paths,
kwargs_fields=kwargs,
)
Here you can find templates for metafile.yml
and conversion_module.py
.