Introduction to fNIRS The Standard Pipeline for fNIRS Analysis
Introduction to fNIRS
0% Completed

No Standard Pipeline, but Best Practices

Over the last five lessons, we have met dozens of decisions about how to choose the pathlength, which quality thresholds to apply, how to handle motion, which filters and regressors to use, how to model the response, how to correct for multiple comparisons, whether to reconstruct images, and how to compute connectivity. Each decision has defensible options, and the combinations run into the thousands. If you are starting in the field, a natural question is whether there is a standard pipeline, and if not, whether the field should simply agree on one. At least for now, it has not (and there are good reasons for that), but the absence of a standard does not mean that anything goes in an analysis.

1. The Lack of a Standard Pipeline

fNIRS is used with instruments of very different designs (Unit 4), in populations that range from preterm infants to older adults and patients, and in paradigms that range from tightly controlled laboratory tasks to conversations and walks outdoors. A pipeline that works well for adults tapping their fingers in a quiet room may not be suitable for infants watching faces or for two people talking. Flexibility in the analysis can therefore be a strength, as it lets the analysis follow the question, the population, and the data.

On the other hand, the same flexibility is also a risk. When many reasonable pipelines exist, different researchers can reach different conclusions from the same data, and a single researcher who tries several pipelines can, even without any intention to mislead, end up reporting the one that produced the clearest result (Lesson 5.2). The question is how large this problem is in practice, and which choices drive it.

2. What Happens When Many Teams Analyze the Same Data

The fNIRS Reproducibility Study Hub (FRESH) initiative addressed this question directly (Yücel et al., 2025). Research teams around the world were given the same two datasets and a set of predefined hypotheses, and asked to test them with whatever analysis they considered appropriate. The first dataset came from an auditory experiment with speech, noise, and silence, and was used to test hypotheses at the group level; the second came from a finger-tapping experiment and was used to test hypotheses in each of ten individual participants. In total, 38 independent analyses were submitted, and no two teams used exactly the same pipeline.

The results are both reassuring and sobering. At the group level, for five of the seven hypotheses, at least 80% of the teams reached the same conclusion, and agreement was highest for hypotheses that were strongly supported by the previous literature. At the level of individual participants, agreement was much lower, and it was higher for participants whose data had a better signal-to-noise ratio. Teams that reported more confidence in their analysis, which was associated with more years of fNIRS experience, agreed with each other more often. Most importantly for this unit, the variability between teams was traced to a small number of stages: how poor-quality data were handled (Lesson 5.2), how the response was modeled, and how the statistics were done, including whether a GLM or block averaging was used, whether channels or regions of interest were tested, and whether multiple comparisons were corrected (Lesson 5.3).

The study also documented how analyses are actually done. Most teams used a GLM, and most of those included short-separation regressors; a minority used block averaging. About half did not correct for multiple comparisons. The authors are careful about one more point that applies to all such studies: agreement between teams is not the same as being right. Consistent results can be consistently wrong, and assessing the accuracy of pipelines requires data with a known answer, such as simulations or synthetic responses added to real recordings (Lesson 5.2).

🎍 MUST-READ PAPER

Yücel, M.A., Luke, R., Mesquita, R.C., von Lühmann, A. et al. (2025). “fNIRS reproducibility varies with data quality, analysis pipelines, and researcher experience.” Communications Biology, 8, 1149.

The FRESH study: 38 independent analyses of the same fNIRS datasets, showing where analysts agree, where they diverge, and which processing and statistical choices explain the differences. Read it alongside the lessons of this unit; almost every decision we discussed appears in its results.

→ doi:10.1038/s42003-025-08412-1

3. Reporting: Making Every Choice Visible

If there is no single correct pipeline, the next best thing is a pipeline that others can see, evaluate, and repeat. This is the purpose of the reporting recommendations organized by the Society for Functional Near-Infrared Spectroscopy (Yücel et al., 2021), which we first met in Lesson 4.2. Written by a large group of researchers in the field, they describe what an fNIRS paper should report, from the participants to the statistics, and include a checklist for authors and reviewers. The table shows the main areas and where this course discussed them.

Area Examples of what to report Lessons
Participants Demographics, inclusion and exclusion criteria, numbers excluded and why, and, where relevant, hair and skin characteristics 4.2, 5.2
Instrument and probe Type of system, wavelengths, sampling rate, separations, short channels, optode positions and how they were registered 4.1, 4.2
Design Task timing, conditions, controls, auxiliary measurements 4.2
Preprocessing Quality metrics and thresholds, motion handling and its parameters, filters, conversion parameters (DPF, extinction coefficients), and the order of the steps 5.1, 5.2
Analysis and statistics The model and all its regressors, the response shape, the noise model, the group model, the chromophores analyzed, regions of interest and how they were defined, the correction for multiple comparisons 5.3, 5.4, 5.5
Software and data Software and versions, and where data and code can be found 5.6

Reporting at this level of detail can feel excessive, but the FRESH results show why it matters: the stages that were most often described vaguely are the same stages that explained most of the disagreement between teams. A methods section that says only “data were preprocessed and analyzed with a GLM” leaves almost every decision of this unit open.

4. Sharing Data, Code, and Plans

Even the most detailed methods section cannot capture every line of an analysis. The most complete form of transparency is to share the data and the code themselves, which lets others repeat the analysis exactly, test alternative choices, and combine datasets. Two community standards make this practical. The Shared Near Infrared Spectroscopy Format (SNIRF) is a common file format for fNIRS data, developed with the academic and commercial community and the Society for Functional Near-Infrared Spectroscopy, which can store data from continuous-wave, frequency-domain, time-domain, and diffuse correlation spectroscopy instruments (Tucker et al., 2023). The Brain Imaging Data Structure (BIDS), originally developed for MRI (Gorgolewski et al., 2016), specifies how the files of a whole study, with its participants, sessions, events, and metadata, should be organized and described. Its extension to near-infrared spectroscopy, NIRS-BIDS, uses SNIRF files within this structure (Luke et al., 2025). Data organized this way can be read by many analysis tools without conversion and deposited in public repositories.

The analysis itself is increasingly done with open-source software. Several toolboxes, in MATLAB and in Python, implement most of the steps discussed in this unit; examples include Homer, the NIRS Brain AnalyzIR toolbox, MNE-NIRS, and Cedalion, among others. Using open tools, and reporting their versions and settings, makes an analysis easier to repeat than one built from undocumented in-house code. Sharing your own scripts, even when they rely on such tools, closes the remaining gap.

Finally, two practices address the flexibility problem of Section 1 directly. Preregistration, a public, time-stamped description of the hypotheses and the planned analysis written before the data are analyzed, separates confirmatory tests from exploratory ones and protects against the hidden search for significance discussed in Lesson 5.2. Sensitivity analyses, in which the main result is repeated with other reasonable choices at the stages most likely to matter (quality thresholds, motion handling, response model, statistics), show readers whether a conclusion depends on one particular pipeline. A result that holds across reasonable pipelines is more trustworthy; a result that does not is still worth reporting, as long as its fragility is reported too.

💭 Pause and Think

Your preregistered analysis shows a significant group difference in HbO₂ over the left prefrontal cortex. A colleague reanalyzes your shared data with a different, equally reasonable motion correction method and a stricter quality threshold, and the difference is no longer significant, although its direction is the same. What do you conclude, and what do you report?

Think about the difference between a preregistered and an exploratory analysis, what the FRESH study found about individual-level and group-level agreement, how the stricter threshold may have changed the sample (Lesson 5.2), and what HbR showed.

Overall, best practices narrow the space of analyses to those that are defensible, make the remaining choices visible, and give others the means to check them. Together with good data, which the FRESH study showed to be one of the strongest predictors of agreement, they are the most effective protection against conclusions that depend on an arbitrary pipeline.

They cannot replace understanding. A checklist can tell you to report your short-separation regression; it cannot tell you whether, in your infants, the short channels also saw the brain. That judgment comes from the physics, physiology, and instrumentation of Units 2 to 4, and from knowing what each processing step does and does not do, which has been the aim of this unit. A dedicated course on fNIRS processing will take these topics further, with hands-on analysis. In the final unit of this course, we step back from methods to the questions that fNIRS is used to answer, and ask in each case why fNIRS, and not another tool, is the right choice.


📌 Key Takeaways

  • There is no single standard fNIRS pipeline, because instruments, populations, and paradigms differ; flexibility is a strength and a risk.
  • In the FRESH study, 38 analyses of the same data agreed well for well-supported group-level hypotheses, less at the individual level; agreement rose with data quality and experience. Variability came mainly from handling poor-quality data, modeling the response, and statistics.
  • Agreement between analyses is not accuracy; accuracy requires data with a known answer.
  • The SfNIRS reporting recommendations (Yücel et al., 2021) list what to report, from participants to statistics; vague methods leave the decisive choices open.
  • Share data in SNIRF and BIDS, share code, use open tools and report their versions, preregister, and run sensitivity analyses.
  • Best practices narrow and expose the choices; understanding what each step does is still what makes an analysis right.

This lesson closes Unit 5. You now know the common processing steps, why each exists, what each can and cannot do, and how to make your choices transparent. In Unit 6, we turn to the applications of fNIRS, from the laboratory to the clinic, and to the open problems at the frontier of the field.

📚 Further Reading & Key References

  1. Yücel, M.A., Luke, R., Mesquita, R.C., et al. (2025). “fNIRS reproducibility varies with data quality, analysis pipelines, and researcher experience.” Communications Biology, 8, 1149. [doi] — The FRESH study of analytical variability in fNIRS.
  2. Yücel, M.A., Lühmann, A.v., Scholkmann, F., et al. (2021). “Best practices for fNIRS publications.” Neurophotonics, 8(1), 012101. [doi] — The SfNIRS reporting recommendations and checklist.
  3. Tucker, S., Dubb, J., Kura, S., et al. (2023). “Introduction to the shared near infrared spectroscopy format.” Neurophotonics, 10(1), 013507. [doi] — The SNIRF file format for fNIRS data.
  4. Gorgolewski, K.J., Auer, T., Calhoun, V.D., et al. (2016). “The brain imaging data structure, a format for organizing and describing outputs of neuroimaging experiments.” Scientific Data, 3, 160044. [doi] — The origin of the BIDS standard.
  5. Luke, R., Oostenveld, R., Cockx, H., et al. (2025). “NIRS-BIDS: Brain Imaging Data Structure extended to near-infrared spectroscopy.” Scientific Data, 12, 159. [doi] — How to organize fNIRS studies in BIDS.

Society for Functional Near-Infrared Spectroscopy.
Content is for educational purposes.