Converting to NWB#

This is the index page gathering links to various aspects of NWB file conversion for silicon probe data, intracellular electrophysiological recording data, and data obtained using calcium imaging.

Install MatNWB Toolbox#

To begin using NWB format in Matlab, you will need to install MatNWB toolbox. To download the toolbox, type in your terminal:

git clone https://github.com/NeurodataWithoutBorders/matnwb.git

Move the downloaded repository to the folder where you keep your code libraries. Then type the following in the Matlab command line:

cd matnwb
addpath(genpath(pwd));
generateCore();

You can now start using MatNWB. MatNWB interface documentation can be accessed here.

Install PyNWB#

To begin using NWB format in Python, you will need to install PyNWB first. To do so, type in your terminal:

pip install -U pynwb

Now you’re ready to start working with PyNWB. The full installation instructions are available here.

Record Metadata#

Record extracellular electrophysiology metadata in Matlab
Record intracellular electrophysiology metadata in Matlab
Record calcium imaging metadata in Matlab
Record extracellular electrophysiology metadata in Python
Record intracellular electrophysiology metadata in Python
Record calcium imaging metadata in Python

Create Electrodes Table#

Create Electrodes table in Matlab
Create Electrodes table in Python

Create Units Table#

Create Units table in Matlab
Create Units table in Python

Add Behavioural Module: Pupil Area Size#

Add pupil area module in Matlab
Add pupil area module in Python

Add Behavioural Module: Total Facial Movement#

Add movement module in Matlab
Add movement module in Python

Convert Intracellular Electrophysiology Recording Data#

Convert current and voltage clamp data in Matlab
Convert current and voltage clamp data in Python
Convert current clamp data recorded in parallel to calcium imaging in Matlab
Convert current clamp data recorded in parallel to calcium imaging in Python

Create Intracellular Recordings Table#

Create intracellular recordings table in Matlab
Create intracellular recordings table in Python

Group Simultaneously Recorded Sweeps#

Group simultaneously recorded sweeps in Matlab
Group simultaneously recorded sweeps in Python

Group Sequentially Recorded Sweeps#

Group sequentially recorded sweeps in Matlab
Group sequentially recorded sweeps in Python

Group Recordings into Runs#

Group recordings into runs in Matlab
Group recordings into runs in Python

Group Runs into Experimental Conditions#

Group runs into experimental conditions in Matlab
Group runs into experimental conditions in Python

Add Grayscale and RGB Images#

Add recording slice image in Matlab
Add recording slice image in Python
Add static fluorescence images in Matlab
Add static fluorescence images in Python

Create Imaging Planes#

Create imaging planes in Matlab
Create imaging planes in Python

Convert Fluorescence Data#

Convert fluorescence data in Matlab
Convert fluorescence data in Python

Convert Change in Fluorescence Intensity Data#

Convert fluorescence intensity change data in Matlab
Convert fluorescence intensity change data in Python

Save NWB File in Matlab#

nwbExport(nwbFileObj, <filename path string>);

Save NWB File in Python#

from pynwb import NWBHDF5IO
with NWBHDF5IO(<filename path string>, "w") as io:
  io.write(nwbFileObj)

Read NWB File#

Read a file with extracellular electrophysiology data in Matlab
Read a file with intracellular electrophysiology data in Matlab
Read a file with calcium imaging data in Matlab
Read a file with extracellular electrophysiology data in Python
Read a file with intracellular electrophysiology data in Python
Read a file with calcium imaging data in Python

Validate NWB File#

For validating NWB files use command line and type in

python -m pynwb.validate <filename path>

The output for a valid NWB file should be:

Validating <filename path> against cached namespace information using namespace 'core'.
 - no errors found.

The program exit code should be 0. On error, the program exit code is 1 and the list of errors is outputted.

For more details on the validation process, refer to an external resource.