The Neurophysiological Biomarker Toolbox (NBT)

NBT file operations

NBT has some basic function for handling NBT files.

Delete analysis files

You can delete analysis files using nbt_DeleteAnalysisFiles(startpath).

Note this function will delete you analysis files! Take care

Delete info files

You can delete info files using nbt_DeleteInfoFiles(startpath).

Note this function will delete you info files! Take care

Rename files to NBT format

To rename you files into NBT format <ProjectID>.<SubjectID>.<Date recording>.<Condition>, you can use nbt_Rename. However, the function requires that your file names are structured in meta-information blocks with separators. I.e. a file name like <SubjectID>_x_x_<Condition>, and not <SubjectID>xx<ConditionID>.

Let us say your file name is <SubjectID>_x_x_<Condition>.mat, you can all nbt_Rename like this

 nbt_Rename(startpath,'.mat', '_', {'ProjectID';1;'yymmdd';4)

The two last arguments are the important; the second last '_' is the block separator; the last is the block definition argument {ProjectID;SubjectID;Date recording;Condition} in the NBT standard format. Note that you can either write a fixed string or define which block of the old file name is should be in the NBT format.

Extract filename tree

To extract the filenames with paths use the nbt_ExtractTree function.

tutorial/nbtdatabasefileoperations.txt · Last modified: 2011/08/02 15:46 by Simon-Shlomo Poil
The NBTwiki platform - version 2.8 - 9 May 2013
Copyright (C) 2008-2015