Optical Density Function Error

Hi All!
We got a university project about fNIRS. So, we have hardware that has four photodiodes and we take a date from each photodiodes after that we write these datas to a .csv file. In our python code after we read data from the .csv file we call this:

raw_intensity = mne.io.RawArray(data, info, verbose=True)

after that when we try to call this function:

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

it gives us an error like:

File “C:\Users\Mr_DB\mne-python\1.0.2_0\lib\site-packages\mne\preprocessing\nirs\nirs.py”, line 165, in _check_channels_ordered
(first_value != pair_vals[0]) or \

IndexError: index 0 is out of bounds for axis 0 with size 0

I’m sharing our file content via Google Drive:


We need your help ASAP please help these young student comrades.


Hi Burak, welcome to the forum! I haven’t downloaded your data yet because I first wanted to check which device manufacturer you were using and whether it would be easier to read it in via one of the functions already made in MNE rather than going through RawArray.

Hello again,
We created our device ourselves using four photodiodes and ESP because in our university project it was written that we had to do everything ourselves. For this reason, we receive our own data over four photodiodes. Since we have never worked on this field before, this situation is a bit of a challenge for us.

We wanted to process the data we received using MNE, and in this part, we get an error as I mentioned in the subject.

We need your help in resolving the error and your advice for our project, BECAUSE WE HAVE TIME LEFT UNTIL JUNE 3RD. :smiling_face_with_tear:

Is there anyone to help us in there?

Best Regards,

Hi @burakiro, that isn’t a lot to go on, if you’re setting up your own device, I think that’s going to involve a lot of troubleshooting and I’m happy to answer specific questions but I personally don’t really have the bandwidth to set up your device with you, it’s a rather large undertaking. Maybe @rob-luke has more helpful advice but I think unfortunately getting the data from a device and into a standardized format like snirf (GitHub - fNIRS/snirf: SNIRF Format Specification) is a bit outside the scope of MNE and our ability to help.

1 Like