Function Reference

# BDF.decodeStatusChannelMethod.

Decode the information stored in the status channel returned by readBDF.

decodeStatusChannel(statusChannel)

Args:

Returns:

Examples:

dats, evtTab, trigChan, statusChan = readBDF("res1.bdf")
statusChanInfo = decodeStatusChannel(statusChanInfo)
if length(findall(statusChanInfo["CMSInRange"] .== false)) > 0
   println("CMS was not in range during at least some portions of the recording")
else
   println("CMS was in range during the whole recording")
end

source

# BDF.readBDFMethod.

Read the data from a BDF file

readBDF(fName; from, to, channels, transposeData)

Args:

Returns:

Examples:

dats, evtTab, trigChan, sysChan = readBDF("res1.bdf")
dats, evtTab, trigChan, sysChan = readBDF("res1.bdf", channels=[1,3]) #read only channels 1 and 3
dats, evtTab, trigChan, sysChan = readBDF("res1.bdf", channels=["Fz","RM"]) #read only channels Fz and RM
dats, evtTab, trigChan, sysChan = readBDF("res1.bdf", transposeData=true) #return transposed data matrix (i.e. nDataPoints X nChannels)

source

# BDF.readBDFHeaderMethod.

Read the header of a BDF file

readBDFHeader(fName)

Args:

Returns:

Examples

bdfInfo = readBDFHeader("res1.bdf")
sampRate = bdfInfo["sampRate"][1]

source

# BDF.splitBDFAtTimeMethod.

Split a BDF file at one or more time points into multiple files.

splitBDFAtTime(fName, timeSeconds; from, to)

Args:

Examples:

splitBDFAtTime("res1.bdf", 50)
splitBDFAtTime("res2.bdf", [50, 100, 150])

source

# BDF.splitBDFAtTriggerMethod.

Split a BDF file at points marked by a trigger into multiple files.

splitBDFAtTrigger(fName, trigger; from, to, minTrigDur)

Args:

Examples:

splitBDFAtTrigger("res1.bdf", 202)

source

# BDF.writeBDFMethod.

Write a BDF file

writeBDF(fName, data, trigChan, statusChan, sampRate; subjID, recID, startDate, startTime, versionDataFormat, chanLabels, transducer, physDim, physMin, physMax, prefilt, reserved)

Args:

Notes:

Only the first five arguments are required. The other arguments are optional and the corresponding BDF fields will be left empty or filled with defaults arguments.

Data records are written in 1-second units. If the number of data points passed to writeBDF is not an integer multiple of the sampling rate the data array, as well as the trigger and status channel arrays will be padded with zeros to fill the last data record before it is written to disk.

Examples:

sampRate = 2048
dats = rand(2, sampRate*10)
trigs = rand(1:255, sampRate*10)
statChan = rand(1:255, sampRate*10)
writeBDF("bdfRec.bdf", dats, trigs, statChan, sampRate)

#add date and time info
writeBDF("bdfRec.bdf", dats, trigs, statChan, sampRate, startDate="23.06.14",
startTime="10.18.19")

source