File IPNWB_NWBUtils.ipf

NWB utility functions.

Unnamed Group

variable GetNoCompression()

Convenience getters.

Igor Pro does not allow cross IM access to constants

variable GetChunkedCompression()
variable GetSingleChunkCompression()
string CompressionModeToString(variable mode)

Functions

string DetermineNamespace(string neurodata_type)

Determine the namespace of the given neurodata type.

Note: - core specification “2.2.0”

  • hdmf-common “1.1.0”

string GetTimeSeriesMissingFields(variable channelType, variable clampMode)

Return the initial values for the missing_fields attribute depending on the channel type, one of IPNWBChannelTypes, and the clamp mode, one in IPNWB_ClampModes.

variable GetChannelTypeFromNeurodataType(string neurodata_type)

Derive the channel type, one of IPNWBChannelTypes, from the neurodata_type attribute and return it.

Parameters:

neurodata_type – string with neurodata type specification defined in nwb.icephys.json_

variable GetClampModeFromNeurodataType(string neurodata_type)

Derive the clamp mode from the neurodata_type attribute and return it.

Parameters:

neurodata_type – string with neurodata type specification defined in nwb.icephys.json_

string DetermineDataTypeFromProperties(variable channelType, variable clampMode)

Determine the neurodata type based on channel type and clamp mode.

See also

IPNWBChannelTypes

See also

IPNWB_ClampModes

Parameters:
  • channelType – one in

  • clampMode – one in

Returns:

neurodata_type string with neurodata type specification defined in nwb.icephys.json_

string ReadNWBVersion(variable fileID)

get the (major) version of the nwb file

Parameters:

fileID – id of open hdf5 file

Returns:

major version e.g. 1 or 2

variable GetNWBMajorVersion(string version)

convert version string to major version

variable AnalyzeNWBVersion(string version, variable *version0, variable *version1, variable *version2)

convert version string to major and all minor numeric versions

Parameters:
  • version[in]

  • version0[out] numeric first part of the version string (major Version)

  • version1[out] numeric second part of the version string (minor Version)

  • version2[out] numeric third part of the version string (sub Version)

Returns:

analyzed numeric versions

variable EnsureValidNWBVersion(variable version)
string LoadSpecification(string specLoc, string specName)

Load the NWB specification from files in the main directory.

Note: Open, FbinRead and Close are not threadsafe

Parameters:
  • specLoc – Igor Pro file path to specifications (Path Separator: “:”)

  • specName – specifications file identifier (without trailing *.json ending)

Returns:

JSON string

string SpecificationsDiscLocation()

Return Folder of NWB:N specifications.

Note: This is typically located at the location of the IPNWB program ipf files. FunctionPath is not threadsafe

string ReadTextAttributeAsList(variable locationID, string path, string name)

Read a text attribute as semicolon ; separated list.

Parameters:
  • locationID[in] HDF5 identifier, can be a file or group

  • path[in] Additional path on top of locationID which identifies the group or dataset

  • name[in] Name of the attribute to load

wave ReadTextAttribute(variable locationID, string path, string name)

Read a text attribute as text wave, return a single element wave with PLACEHOLDER if it does not exist.

Parameters:
  • locationID[in] HDF5 identifier, can be a file or group

  • path[in] Additional path on top of locationID which identifies the group or dataset

  • name[in] Name of the attribute to load

string ReadTextAttributeAsString(variable locationID, string path, string name)

Read a text attribute as string, return PLACEHOLDER if it does not exist.

Parameters:
  • locationID[in] HDF5 identifier, can be a file or group

  • path[in] Additional path on top of locationID which identifies the group or dataset

  • name[in] Name of the attribute to load

variable ReadAttributeAsNumber(variable locationID, string path, string name)

Read a text attribute as number, return NaN if it does not exist.

Parameters:
  • locationID[in] HDF5 identifier, can be a file or group

  • path[in] Additional path on top of locationID which identifies the group or dataset

  • name[in] Name of the attribute to load

wave ReadTextDataSet(variable locationID, string name)

Read a text dataset as text wave, return a single element wave with PLACEHOLDER if it does not exist.

Parameters:
  • locationID – HDF5 identifier, can be a file or group

  • name – Name of the HDF5 dataset

string ReadTextDataSetAsString(variable locationID, string name)

Read a text dataset as string, return PLACEHOLDER if it does not exist.

Parameters:
  • locationID – HDF5 identifier, can be a file or group

  • name – Name of the HDF5 dataset

variable ReadDataSetAsNumber(variable locationID, string name)

Read a text dataset as number, return NaN if it does not exist.

Parameters:
  • locationID – HDF5 identifier, can be a file or group

  • name – Name of the HDF5 dataset

variable WriteTextDatasetIfSet(variable locationID, string name, string str, variable compressionMode = defaultValue)

Write a text dataset only if it is not equal to PLACEHOLDER.

Parameters:
  • locationID – HDF5 identifier, can be a file or group

  • name – Name of the HDF5 dataset

  • str – Contents to write into the dataset

  • compressionMode – [optional, defaults to NO_COMPRESSION] Type of compression to use, one of CompressionMode

string GetNWBgroupPatchClampSeries(variable version)

get location of the patchclamp series acquisition object

Parameters:

version – target NWB version

Returns:

full path to patchclampseries group

string GetNWBVersionString(variable version)

get NWB version for current Igor Pro implementation

Parameters:

version – maior NWB version e.g. 2

Returns:

full version string in the format (?:NWB-)?[1,2]\.[0-9](?:\.[0-9])?[b]?

variable GetNWBVersion()

get latest supported NWB version

Returns:

maior version

string GetHistoryAndLogFileDatasetName(variable version)

Return the name of the history dataset.

Variables

static const string NWB_PATCHCLAMPSERIES_V1 = "/acquisition/timeseries"
static const string NWB_PATCHCLAMPSERIES_V2 = "/acquisition"
static const string NWB_VERSION_V1 = "NWB-1.0.5"
static const string NWB_VERSION_V2 = "2.2.4"