The code within this repository is the reference implementation for the TDDR algorithm as described in:
Fishburn F.A., Ludlum R.S., Vaidya C.J., & Medvedev A.V. (2019). Temporal Derivative Distribution Repair (TDDR): A motion correction method for fNIRS. NeuroImage, 184, 171-179. doi: 10.1016/j.neuroimage.2018.09.025
Matlab:
signals_corrected = TDDR(signals, sample_rate);
Python:
from TDDR import TDDR
signals_corrected = TDDR(signals, sample_rate);
signals: A [sample x channel] matrix of uncorrected optical density data
sample_rate: A scalar reflecting the rate of acquisition in Hz
signals_corrected: A [sample x channel] matrix of corrected optical density data
The TDDR algorithm is implemented in the nirs.modules.TDDR
module. Typical usage looks like this:
% Construct preprocessing job with TDDR motion correction
job = nirs.modules.OpticalDensity();
job = nirs.modules.TDDR(job);
job = nirs.modules.BeerLambertLaw(job);
% Run job on raw data
hb = job.run(raw);
While Homer2 does not yet contain the TDDR method, a Homer2-compatible script is available in this repository at toolboxes/Homer2/hmrMotionCorrectTDDR.m
. Usage is similar to other motion correction scripts shipped by Homer2.