NwbFile

class NwbFile(propValues)[source]

Bases: types.core.NWBFile

NWBFILE - Root object representing an NWB file.

Requires that core and extension NWB types have been generated and reside in a +types namespace on the MATLAB search path.

Usage:

Example 1 - Construct a simple NwbFile object for export:

nwb = NwbFile;
nwb.epochs = types.core.Epochs;
nwbExport(nwb, 'epoch.nwb');
Constructor Summary
NwbFile(propValues)

NWBFILE - Create an NWB File object

Method Summary
applyDatasetSettings(settingsReference, options)

APPLYDATASETSETTINGS - Configure datasets using NWB dataset settings

Syntax:

nwb.applyDatasetSettings(settingsReference) applies a dataset configuration profile to the nwb-file nwb. This method accepts the filename of a custom configuration profile or a structure representing a configuration profile.

Input Arguments:
  • obj (NwbFile) - An instance of the NwbFile class.

  • settingsReference (string | struct) - The filename of a custom configuration profile or an in-memory structure representing a configuration profile.

Name-Value Arguments:
  • OverrideExisting (logical) - This boolean determines if existing DataPipe objects in the file will be reconfigured with the provided options. Default is false. Important: This does not work for DataPipes that has previously been exported to file.

Output Arguments:
  • datasetConfig - (Optional) The configuration settings applied to the dataset.

applyDatasetSettingsProfile(profile, options)

APPLYDATASETSETTINGSPROFILE - Configure datasets using predefined settings profile

Syntax:

nwb.applyDatasetSettingsProfile(profile) applies a dataset configuration profile to the nwb-file nwb. Available profiles: “default”, “cloud”, “archive”. This will configure datasets in the NwbFile object for chunking and compression.

Input Arguments:
  • obj (NwbFile) - An instance of the NwbFile class.

  • profile (ConfigurationProfile) - Specifies the settings profile to use. Default is “none”.

Name-Value Arguments:
  • OverrideExisting (logical) - This boolean determines if existing DataPipe objects in the file will be reconfigured with the provided options. Default is false. Important: This does not work for DataPipes that has previously been exported to file.

Output Arguments:
  • datasetConfig - (Optional) The configuration settings applied to the dataset.

export(filename, mode)

EXPORT - Export NWB file object

getTypeObjects(typeName, options)

GETTYPEOBJECTS - Retrieve NWB objects of a specified type.

Syntax:
nwbObjects = GETTYPEOBJECTS(obj, typeName) Retrieves NWB

objects of the specified type from the NwbFile object.

nwbObjects = GETTYPEOBJECTS(obj, typeName, Name, Value) Retrieves NWB objects of the specified type from the NwbFile object using provided name-value pairs controlling options.

Input Arguments:
  • obj (NwbFile) - The NwbFile object from which to retrieve NWB objects.

  • typeName (1,1) string - The name of the type to search for. Can include namespace, but does not have to, i.e types.core.TimeSeries and TimeSeries are supported.

  • options (name-value pairs) - Optional name-value pairs. Available options:

    • IncludeSubTypes logical - Optional: set to true to include subclasses in the search. Default is false.

Output Arguments:
  • nwbObjects (cell) - A cell array of NWB objects of the specified type.

Usage:

Example 1 - Get all ElectricalSeries objects from NwbFile:

evalc('run("ecephys.mlx")');
nwb.getTypeObjects('ElectricalSeries')

Example 2 - Get all ElectricalSeries and subtype objects from NwbFile:

evalc('run("ecephys.mlx")')
nwb.getTypeObjects('ElectricalSeries', 'IncludeSubTypes', true)
listNwbTypes(options)

listNwbTypes() - List all unique NWB (neurodata) types in file

resolve(path)
searchFor(typename, varargin)

searchFor() - Search for for a given typename within the NwbFile object

Including the full namespace is optional.

Warning

The returned paths are resolvable but do not necessarily indicate a real HDF5 path. Their only function is to be resolvable.