How to set reject criteria

Hi everyone,

I have a quick question regarding reject criteria for fNIRS data. Our lab has been collecting data using auditory comprehension tasks consisting of 3 experimental conditions and 3 control conditions.

I have been simply following the codes and tutorials provided with our dataset to see how it works with our data. I became curious about reject criteria used in the example code. The reject criteria set to 80e-6 with a finger tapping dataset. Should I use the same criteria for our dataset? Can you tell me how you got to the reject criteria, 80e-6?

When I ran the code, it seems all epochs rejected. To me, it sounds like there’s no data that I can further explore. Did I understand it in a correct way?

Thank you for your help in advance!

If you have a question or issue with MNE-Python, please include the following info:

  • MNE-Python version: 0.23.3
  • operating system: Window 10

Hello @kim1208,

the figure you posted indicates that more than 80% of your epochs were dropped because they were “too short”. This is extremely unusual – normally, epochs become “too short” if the trigger events one uses to create them occur too closely to the beginning or end of the recording, such that there’s simply not enough data to create these epochs. This commonly only affects a handful of epochs, if any. So what we’re seeing here is very odd.

Can you please share the code you’re using to create those epochs?

Also, please fill in the version of MNE-Python you’re using in the posting template (you can edit your posting).

Thanks,
Richard

Hi Richard,

Thank you for your response. I copied and pasted my codes below. I set the annotations and the look at the plots and information about the annotation in the data, which seems correct to me. FYI, I attached a plot that I got below.
image

I am a beginner of Python as well, and I don’t know how I can share the code more efficiently than this.

raw_intensity = mne.io.read_raw_snirf(filepath) 
raw_annot = mne.Annotations(onset=raw_intensity.annotations.onset,  # in seconds
                           duration=[68, 30, 66, 30, 65, 30],  # in seconds, too
                           description=['Exp 1', 'Cont 1', 'Exp 2', 'Cont 2', 'Exp 3', 'Cont 3'])
raw_intensity.set_annotations(raw_annot)

raw_od = mne.preprocessing.nirs.optical_density(raw_intensity)
raw_haemo = mne.preprocessing.nirs.beer_lambert_law(raw_od)

mne.events_from_annotations(raw_haemo)

events, event_dict = mne.events_from_annotations(raw_haemo)
fig = mne.viz.plot_events(events, event_id=event_dict,
                          sfreq=raw_haemo.info['sfreq'])
fig.subplots_adjust(right=0.7)  # make room for the legend

reject_criteria = dict(hbo=80e-6)
tmin, tmax = -5, 300

epochs = mne.Epochs(raw_haemo, events, event_id=event_dict,
                    tmin=tmin, tmax=tmax,
                    reject=reject_criteria, reject_by_annotation=True,
                    proj=True, baseline=(None, 0), preload=True,
                    detrend=None, verbose=True)
epochs.plot_drop_log()

Thank you!

I assume this is simply too long. How long is your recording? Here, you’re trying to create epochs of 305 seconds (i.e., 5:05 min) duration. Are you absolutely sure that’s what you intended to do?

Hi Richard,

Maybe I misunderstood the function of tmin and tmax. I thought it would cover the entire recording of the task which is 6 min 6 seconds.

I have three experimental conditions taking 1 minute long, and three control conditions taking 35 seconds in one task/ An inter-stimulus interval of either 10 or 12 seconds occurs between story and reverse speech trials. Each run begins with 15 seconds of rest.

What number should I input here since the length of the conditions varies in our task. Lastly, should I still keep the reject criteria 80e-6? It would be greatly helpful to hear your opinion. Thank you!

Best,
Kim

I’m not sure exactly what the misunderstanding is, so here are a few points of clarification; hopefully one of them helps you:

  1. Every epoch must be the same length. This is an integral feature of the Epochs data structure in MNE-Python. Usually the length is dictated by your analysis plan, e.g., for an evoked / event-related experimental paradigm, you might want to analyze 100ms pre-stimulus and 1000ms post-stimulus time, in which case every epoch would be 1100ms long.
  2. The variable events decides where time=0 will be for each epoch.
  3. tmin and tmax determine the start and end of each epoch relative to the t-zero times set by events. So in the example above in point (1), you would do tmin=0.1, tmax=1.0 (because they’re expressed in seconds, not milliseconds).
  4. the peak-to-peak rejection criterion is highly data dependent and there is little general advice possible. For EEG, for example, the signal amplitude can depend on the hardware manufacturer, the subject’s hair length/thickness, how recently they showered, etc. You really just have to either (1) know what is typical for your system and population, or (2) look at your raw data, look at what the typical values are, take note of some obvious artifacts and how big their amplitudes are, and set the threshold at a level in between the typical peak values and the artifactual peak values.
1 Like

Thanks @drammock for the excellent explanations!

@kim1208 Just in case it didn’t become absolutely clear through @drammock’s response: you don’t want to have an entire task in your epoch, but rather you want to create epochs around each individual “experimental event of interest” (e.g., stimulus onset, or stimulus offset, or response onset, …)

Also tagging @rob-luke, our fNIRS expert, who might be able to point you to some beginners’ resources or give some general advice.

Best wishes,
Richard

Thanks @kim1208 for trying MNE with your fNIRS data.

I concur with the comments from @drammock and @richard. Specifically the reject criteria is highly dependent on the population and task, I usually aim to reject 5-10% of trials but that’s not based on any specific literature.

You can find additional fNIRS tutorials at Examples — MNE-NIRS 0.1.2-dev documentation but I encourage you to also read the MNE-Python documentation as concepts such as filtering, picking, epoching, etc are common across neuroimaging modalities.

Good luck and please let us know how you go and any other snags you hit,
Rob

1 Like