Using the NwbFile Class

The NwbFile class represents the root object for the NWB file and consists of properties and values which map indirectly to the internal HDF5 dataset.

https://github.com/NeurodataWithoutBorders/nwb-overview/blob/main/docs/source/img/matnwb_NwbFile.png?raw=true

In most cases, the types contained in these files were generated by the embedded NWB schema in the file (or separately if you opted to generate them separately). These types can be traversed using regular MATLAB syntax for accessing properties and their values.

Aside from the generated Core and Extension types, there are “Untyped” utility Types which are covered in greater detail in Utility Types in MatNWB.

Searching by Type

The NwbFile also allows for searching the entire NWB file by type using it’s NwbFile.searchFor() method.

You can search for only the class name:

https://github.com/NeurodataWithoutBorders/nwb-overview/blob/main/docs/source/img/matnwb_searchForExample.png?raw=true

Or use the 'includeSubClasses' optional argument to search all subclasses:

https://github.com/NeurodataWithoutBorders/nwb-overview/blob/main/docs/source/img/matnwb_searchForExample-withSubclassing.png?raw=true

Note

As seen above, the keys of the Map returned by the NwbFile.searchFor() method can be paired with the NwbFile.resolve() method to effectively retrieve an object from any NwbFile. This is also true for internal HDF5 paths.