R/apply_mbll.R
apply_mbll.RdApplies the Modified Beer Lambert Law to the change in optical density data to calculate the change in concentration of oxygenated and deoxygenated hemoglobin.
apply_mbll(deltaOdData, extMatrix, pathLength = 2.5, dpf = 6)(DATAFRAME) NIRS data containing the delta od values for each channel. This should be in the format of the output from the function create_delta_ods.
(MATRIX) The extinction coefficients for each wavelength. This should be in the format of the output from the function create_ext_matrix.
(NUMERIC) a value specifying the pathlength of the light through the tissue. This should be in cm. The default value is 2.5.
(NUMERIC) a value specifying the differential path length factor. The default value is 6.
a data frame which adds the HbO and HbR values for each channel to new columns.
create_delta_ods, create_ext_matrix, import_nirs
if (FALSE) {
# Import the NIRS data
nirsData <- import_nirs("path/to/nirs/data.nir")
# Create the delta ODs
nirsData <- create_delta_ods(nirsData, reference = "baseline")
# Create the extinction matrix
extMatrix <- create_ext_matrix(lambda1 = 730, lambda2 = 850, table= "wray")
# Apply the Modified Beer Lambert Law
nirsData <- apply_mbll(data, extMatrix)
}