Converting Data To NWB

The goal of NWB is to package experiment data with the metadata necessary to analyze the data. All of the data from a particular session goes into a single file. This includes the neurophysiology data itself, but also includes other data such as information about the data acquisition, experiment design, experimental subject, and behavior of that subject. The NWB core schema defines data containers for common data objects in neurophysiology data, including: extracellular electrophysiology (e.g., Neuropixels probes), optical physiology (e.g., two-photon imaging), intracellular electrophysiology (e.g., patch clamping), and behavior.

NWB Data and Metadata

All of these data types and relationships are defined in the NWB Schema using the HDMF specification language. NWB is faced with the challenge of supporting a large variety of different experiment types, so the data types and relationships can get quite complex. For this reason, the NWB development team provides tools and APIs, described below, to help users easily and efficiently read and write NWB files.

Converting neurophysiology data to NWB involves:

  1. Reading data and metadata from source files
  2. Adding necessary metadata
  3. Writing data and metadata to NWB following best practices
  4. Packaging large datasets for optimal cloud deployment

The following sections start with the most automated and convenient approaches and proceed to more programming-heavy and customizable solutions. Each tool offers different levels of flexibility and control, allowing you to choose the right approach for your specific needs.

Available Tools

NWB GUIDE (GUI for Data Entry)

Type: Downloadable application

Features:

  • Guides users through data conversion process
  • Supports 40+ common data formats
  • Allows metadata entry
  • Offers NWB file inspection via NWB Inspector
  • Offers data visualization via Neurosift
  • Facilitates uploading to DANDI Archive

Limitations: May require manual addition of lab-specific data

NeuroConv

Type: Python library (underlies NWB GUIDE)

Features:

  • Supports 45+ neurophysiology data formats
  • Offers more flexibility than NWB GUIDE
  • Provides tools for post-hoc time alignment of multiple data streams
  • Supports cloud deployment

PyNWB

Type: Python library (underlies NeuroConv)

Features:

  • Building NWB files from scratch
  • Working with unsupported data formats
  • Developing custom NWB extensions

MatNWB

Type: MATLAB library

Features:

  • Building NWB files from scratch
  • Working with unsupported data formats

Choosing the Right Tool

  1. For most common data formats and straightforward conversions, start with NWB GUIDE.
  2. If you need more flexibility or are comfortable with Python, consider NeuroConv
  3. For custom data formats, complex conversions, or when developing NWB extensions, use PyNWB or MatNWB.

Remember to consult the provided documentation and tutorials for detailed guidance on using each tool