Skip to content

← nirs package

IntensityToOpticalDensity

Convert light intensity to delta-optical density (OD).

This node performs a simple conversion of light intensity as measured by an fNIRS system to the dimensionless quantity delta Optical Density, which does not depend on the unit or scale of the intensity measure. Optical Density can be thought to quantify the degree to which the medium between source and detector absorbs light. The delta refers to the fact that the optical density is here being calculated with respect to, not the true incoming light intensity, but a somewhat arbitrary proxy, which is here the average intensity for the recording. So it is the difference in optical density with respect to the average state of the channel. The delta-OD, simply referred to as OD, can be used to calculate chromophore concentration changes (e.g., HbO, HbR, HbT) relative to the average concentration, using the node EstimateConcentrations. Version 1.0.0

Ports/Properties

data

Data to process.

verbose name
Data
default value
None
port type
DataPort
value type
Packet (can be None)
data direction
INOUT

adapt_online

Whether to update the mean on streaming data. This will incrementally re-estimate the mean over the whole data, including any calibration data.

verbose name
Adapt Online
default value
False
port type
BoolPort
value type
bool (can be None)

trim_proportion

Proportion of lowest/highest values to ignore in robust trimmed mean. This can be set to 0 to use the regular mean (textbook fNIRS approach), 0.5 to use the median, or in between to achieve robustness to a proportion of abnormally high/low data values. This currently applies to offline processing only.

verbose name
Trim Proportion
default value
0.1
port type
FloatPort
value type
float (can be None)

bias

Optional numerical bias value. This is to prevent division by zero or logarithm of zero. By default no bias is applied.

verbose name
Numerical Bias
default value
1e-07
port type
FloatPort
value type
float (can be None)

unreferenced

Output unreferenced measure. If this is checked, the optical density will not be relative to the average intensity, but instead the offset will remain uncorrected. One case where this can make sense is during online processing, if the subsequent modeling stage can account for an arbitrary signal offset.

verbose name
Unreferenced
default value
False
port type
BoolPort
value type
bool (can be None)

ensure_nonnegative

Ensure that the incoming intensity data is non-negative. Typically that should not be the case, but some operations (like resampling) can create small sways into the negative range.

verbose name
Ensure Nonnegative
default value
True
port type
BoolPort
value type
bool (can be None)

round_digits

Round result to this many digits after the decimal point. This can be used to obtain numerically identical results on different processor architectures despite the logarithm being implemented potentially differently.

verbose name
Round Digits
default value
None
port type
IntPort
value type
int (can be None)

keep_intensity

Keep the intensity stream in the output.

verbose name
Keep Intensity
default value
False
port type
BoolPort
value type
bool (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)