# Set up reject criteria in fNIRs preprocessing

**URL:** <https://mne.discourse.group/t/set-up-reject-criteria-in-fnirs-preprocessing/7151>\
**Category:** Support & Discussions\
**Tags:** preprocessing, fnirs\
**Created:** [June 28, 2023, 3:24am UTC](https://mne.discourse.group/t/set-up-reject-criteria-in-fnirs-preprocessing/7151 "2023-06-28T03:24:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DGao](https://avatars.discourse-cdn.com/v4/letter/d/f05b48/32.png) [@DGao](https://mne.discourse.group/u/DGao)\
**Post date:** [June 28, 2023, 3:24am UTC](https://mne.discourse.group/t/set-up-reject-criteria-in-fnirs-preprocessing/7151/1 "2023-06-28T03:24:37Z")

</div>

Hello,

I have a question of using the reject\_criteria in fNIRs preprocessing.

The MNE documentation says reject\_criteria = dict(hbo=80e-6) sets the maximum acceptable peak-to-peak amplitudes for each channel type in an epoch.

My questions, can I set the reject criteria in terms of absolute peak value instead of peak-to-peak value? For example, reject epochs has peak higher than 80 or lower than -80? Thank you.

- MNE version: 1.3.1
- operating system: Windows 11

---

<div class="post-metadata">

**Author:** ![mscheltienne](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mscheltienne/32/827_2.png) [@mscheltienne](https://mne.discourse.group/u/mscheltienne)\
**Post date:** [June 28, 2023, 11:09am UTC](https://mne.discourse.group/t/set-up-reject-criteria-in-fnirs-preprocessing/7151/2 "2023-06-28T11:09:55Z")

</div>

Hello,

I think the simplest is to annotate programmatically segments which exceed your thresholds with a “bad\_amplitude” annotation. Then when creating your epochs, set `reject_by_annotation=True` and epochs which partially overlaps those bad annotation will be dropped.

You can have a look at the code of `annotate_amplitude`: [mne-python/mne/preprocessing/annotate\_amplitude.py at main · mne-tools/mne-python · GitHub](https://github.com/mne-tools/mne-python/blob/main/mne/preprocessing/annotate_amplitude.py#L18-L194)  
IIRC It’s annotating based on PTP as well, but maybe you can adapt it to your need with an absolute peak amplitude.

Mathieu

---

<div class="post-metadata">

**Author:** ![Alina](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@Alina](https://mne.discourse.group/u/Alina)\
**Post date:** [February 6, 2026, 12:07pm UTC](https://mne.discourse.group/t/set-up-reject-criteria-in-fnirs-preprocessing/7151/3 "2026-02-06T12:07:07Z")

</div>

Hi,

I have a related question to the annotation of bad channels and segments for glm analysis. As far as I understand bad channels and segments will automatically rejected for Epoching, but the glm\_run() function does not allow any argument like “reject\_by\_annotation” to explicitly exclude bad channels.

I use this code to disregard bad channels for the results:

_glm\_est = run\_glm(raw\_haemo.copy().pick(‘fnirs’,exclude=‘bads’), design\_matrix, noise\_model = ‘ar5’)_

but I am not sure if there is a way to also disregard bad segments in the glm as identified by the peak\_power() function? Are these annotations automatically passed to the glm function or would I manually need to crop the data which might mess up the regressors?

mne nirs version: 0.7.1, operating system: windows 11

Alina
