The Neurophysiological Biomarker Toolbox (NBT)

# Implementing new biomarkers

If the biomarker you are interested in is not implemented in NBT yet, you can use several templates to implement the calculation of the new biomarker in NBT. Biomarkers are stored in biomarker objects, you will first have to write a script that defines a new NBT Biomarker object. You can use the nbt_Biomarker_template to make your new biomarker object (see instructions in the script). The script that defines your new biomarker should be saved in a file with the same name as the new biomarker, in this case we saved it in the file nbt_Biomarker_template. If you now want to create an object of the type nbt_Biomarker_template, you can do the following (where the input '129', assumes you have 129 channels):

object=nbt_Biomarker_template(129)

To calculate the biomarker values, you can use the nbt_doBiomarker_template. You will have to add to this script the algorithm to compute your biomarker, and the name of the new NBT biomarker object to store your results (see instructions in the script).

If you want to apply the analysis function to multiple NBT Signal files in a folder - you first need to define a “run script”: e.g.

function nbt_runBiomarker_template(Signal, SignalInfo, SaveDir)
BiomarkerObject = nbt_doBiomarker_template(Signal,SignalInfo,<yourParameters>)
nbt_SaveClearObject('BiomarkerObject',SignalInfo,SaveDir);
end

This function should then be given to nbt_NBTcompute to run. For example:

nbt_NBTcompute(@nbt_runBiomarker_template,'Signal','B:/NBT files')

nbt_NBTcompute loops through the directory 'B:/NBT files' and subfolders, and applies the function nbt_runBiomarker_template to all signal files. It stores the analysis results in biomarker objects and saves them in analysis files. Analysis files have the same name as the files that contain the signal, extended with _analysis. They contain one or more biomarker objects. nbt_NBTcompute skips NBT info and analysis files, which are usually in the same directory as the signal files. Other not .mat files can be present, if you set the input SignalFileExt in nbt_NBTcompute to '.mat'. Note that in nbt_runBiomarker_template you can call more than one biomarker. Just remember to call nbt_SaveClearObject, otherwise your biomarkers will not be saved.

The standard file names in NBT are:

• nbt_BiomarkerName - the biomarker object definition
• nbt_doBiomarkerName - the analysis function that does the computation of the biomarker.
• nbt_runBiomarkerName - to store and save the biomarker, also used if the biomarker requires specific pre-processing. See, e.g., the nbt_DFA biomarker.