# Assessment of fNIRS Signal Processing Pipelines: Towards Clinical Applications
## 2 Materials and Methods
### Signal Correction Metrics  
The proposed comparison of pipeline variants (changing the MA reduction with the same filtering and PCA) suffers from a lack of ground-truthing. A possible way to systematically compare the results of different pipelines includes an assessment with Receiving Operating Characteristics (ROC) curves of simulated data [34]. This process is highly recommended to simulate HRF activation over resting-state data, which were not available during data acquisition. Therefore, given this limitation, we monitored the effects in energy reduction exerted by each step and its variants.  
The Energy Relative Decrease (ERD) was tabulated over optical density at each step of the processing pipeline--namely, at MA rejection, BPF, and PCA steps--with respect to the starting energy of the un-processed optical density data as a percentage of energy reduction. This concept can be summarized the following equation  
\[ERD_{step}\%=\frac{E_{f,step}-E_{i}}{E_{i}}100\% \tag{7}\]  
where \(E_{f,step}\) and \(E_{i}\) indicate the respective mean total energy of the \(\Delta OD\) signals ahead of the single pre-processing step and prior to MA reduction.  
The performances of the BPF filter step in the 0.01-0.2 Hz frequency range were additionally tabulated according to the power ratio between filtered and unfiltered signals. More precisely, the Power Ratio within-band (\(PR_{wb}\)) and outside-band (\(PR_{wb}\)) (i.e., passband and stopband, respectively) was computed as a percentage ratio between the mean Power Spectral Density (PSD) ahead and prior to the BPF step. This concept can be summarized in the following equation  
\[PR_{wb}[\%]=\frac{F_{PSDwb}}{U_{PSDwb}}100 \tag{8}\]  
Figure 2: Schematic representation of the block-design motor grasping task (**bottom**) and indicative illustration of blinking cross over the stimulus presentation screen according to task vs. resting conditions (**top**).  
\[PR_{ob}[\%]=\frac{F_{PSDb}}{U_{PSDb}}100 \tag{9}\]  
where \(F_{PSD}\) and \(U_{PSD}\) indicate the respective filtered and unfiltered PSD of \(\Delta OD\) signals.  
Finally, the resulting significant activations by block-average and group-level analysis were compared, which provided an overall quality assessment since the expected activations presented high confidence in the simple motor task on healthy subjects. Hence, the block-average outcomes of the differently cleaned fNIRS signal were plotted and visually compared. The block average step was performed with Homer2 software (_hmrBlockAvg_ function), while group-level maps of activation were computed by means of the NIRS Brain AnalyzIR Toolbox as a Mixed Effect Model (task condition as a Fixed effect, while intercept was a random effect using subjects as a grouping variable). It is worth noting that for performing group-level analysis and hence subject-level GLM analysis, the filtering step was modified to HPF instead of BPF according to the motivations explained in Section 2.6.  
A synthetic measure of SNR was extracted from block-averaged responses across subjects according to the following equation  
\[SNR\;[dB]=10\log_{10}\left(\frac{E_{BA}(t_{activation})}{E_{BA}(t_{baseline})}\right) \tag{10}\]  
where \(E_{BA}(t_{activation})\) and \(E_{BA}(t_{baseline})\) indicate the respective total energy of the block-averaged response over equal time periods where we expect the maximum of activation vs. return to baseline concentrations. Namely, \(t_{activation}\) was set in the 6-12 s range after the stimulus onset, with \(t_{baseline}\) in the 24-30 s range.