Issue with pulling correct fNIRS event triggers from .hdr files

Hello,

I am brand new to using the mne toolbox for fNIRS data processing. My lab is transitioning from using MATLAB’s nirs toolbox so I am familiar with that syntax but still learning mne.

Our data was recorded with a NIRx Scout system and NIRStar software. During recording, something happened and the event trigger markers were improperly inserted in the data recording. We were able to manually adjust the markers by using the data log files to update the .hdr files. This worked for the MATLAB nirs toolbox but for some reason the updated .hdr files are not being pulled in correctly for the mne toolbox. It’s actually pulling in the old, incorrect series of trigger markers and I am not sure how to fix this. If I remove the .hdr file from the pathway, the script doesn’t work so I would assume it should be pulling the trigger data from the .hdr file…

If anyone has any advice on how to fix this I would greatly appreciate input, thanks so much!!

  • MNE version: e.g. 1.6.1
  • operating system: Windows 10

Below code is converting raw NIRS data into snirf format and then loading in a single file to check quality of data. The plot section at the end is where we are checking to make sure triggers are correctly loaded, which they are not. This is where I first saw that the old triggers are still being pulled in and not the updated ones.

fnirs_data_folder = r"\\boystown.org\btnrh\SecureCollab\fNIRS-FunHear\Reverb_fNIRS\Data\fNIRS_S003\CNC\sourcedata\sub-ACI002\ses-01\nirs"
fnirs_raw_dir = os.path.join(fnirs_data_folder, '2022-07-30_006')
raw_intensity = mne.io.read_raw_nirx(fnirs_raw_dir).load_data()

subject = "ACI002"          # change subject file name to inspect single participant
session = "01"

bpath = BIDSPath(subject = subject, session = session, datatype = 'nirs', root = '//boystown.org//btnrh//SecureCollab//fNIRS-FunHear//Reverb_fNIRS//Data//fNIRS_S003//CNC//sourcedata')
# Above is the path for all of our data
dname = str(bpath.directory)

fname = dname + "/" + next(os.walk(dname))[1][0]
fname

raw_intensity = mne.io.read_raw_nirx(fname, preload=True)  # reads raw nirx file
raw_od = optical_density(raw_intensity)

raw_intensity.plot(n_channels=len(raw_intensity.ch_names),
                duration=5000, show_scrollbars=False)

Thank you for any help you can provide, I greatly appreciate it!!