Skip to content

← nirs package

TDDR

This node implements the TDDR method for fNIRS motion artifact reduction.

The method squashes jumps or sleep slopes in the data using Tukey's bisquare weight to score outliers. The online implementation has an approximately zero-mean output, while the offline implementation outputs the same mean as the original data (like the published method). Applying the node to concentration is recommended over applying to optical density, since the node could have unintended side effects on the concentration estimates otherwise. CAUTION: the method should be applied only to the low-frequency part of the data (typically below 0.5 Hz). For this, use a band-splitting filter prior to using this node (e.g., FIR Filter). For the offline case there is also the offline_prefilter option, which is a simple built-in filtering step. This filter is meant to be run on continuous data. That is, it should not be preceded by a Segmentation node. Version 0.8.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

diagnostic

Motion artifact diagnostics. Offline only.

verbose name
Diagnostic
default value
None
port type
DataPort
value type
Packet (can be None)
data direction
OUT

stats_window

Sliding window length, for online processing only. The node calculates statistics over a running window of this length (in seconds).

verbose name
Stats Window
default value
300
port type
FloatPort
value type
float (can be None)

mean_window

Effective window length of for mean tracking, online only. This is the halving time for an exponentially weighted window used to remove trends in the output (in seconds).

verbose name
Mean Window
default value
20
port type
FloatPort
value type
float (can be None)

bisquare_constant

Tuning constant of Tukey's Bisquare weight. The default of 4.685 has 95% statistical efficiency, and lower values of 4.00 and 3.55 have 90% and 85%, respectively.

verbose name
Bisquare Constant
default value
4.685
port type
FloatPort
value type
float (can be None)

simulate_online

Simulate online processing even if data is available offline.

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

maxiter

Max number of iterations for IRLS procedure.

verbose name
Maxiter
default value
50
port type
IntPort
value type
int (can be None)

reltol

Relative trend error during IRLS optimization. Smaller values will take longer to estimate, but the trend will be estimated to a higher accuracy.

verbose name
Reltol
default value
1e-05
port type
FloatPort
value type
float (can be None)

offline_prefilter

Apply zero-phase Butterworth pre-filter (offline only). This is mostly for comparison with the published TDDR method.

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

diagnostic_threshold

Threshold for the outlyingness score to calculate the fraction of samples above threshold diagnostic.

verbose name
Diagnostic Threshold
default value
0.8
port type
FloatPort
value type
float (can be None)

use_caching

Use caching.

verbose name
Use Caching
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)