mne-tools / mne-nirs

Process Near-Infrared Spectroscopy Data in MNE
https://mne.tools/mne-nirs/
BSD 3-Clause "New" or "Revised" License
79 stars 35 forks source link

SNIRF file generated by OBELAB software. #536

Open mehshankhan opened 6 months ago

mehshankhan commented 6 months ago

i am using OBELAB device to acquire fNIRS data. It's processing tool has an option of generating file in SNIRF format. after converting the file in snirf format i am using mne to read data and got the error:

CODE:

import mne
snirf_file = 'Converted_p1.snirf'
raw = mne.io.read_raw_snirf(snirf_file)

ERROR:

Traceback (most recent call last):

  Cell In[2], line 7
    raw = mne.io.read_raw_snirf(snirf_file)

  File ~\anaconda3\envs\data\lib\site-packages\mne\io\snirf\_snirf.py:56 in read_raw_snirf
    return RawSNIRF(fname, optode_frame, preload, verbose)

  File <decorator-gen-180>:12 in __init__

  File ~\anaconda3\envs\data\lib\site-packages\mne\io\snirf\_snirf.py:372 in __init__
    lpa = diglocs[idx, :3]

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

I also validated the file using provided validator.

Code:

result = snirf.validateSnirf('Converted_p1.snirf')
assert result.is_valid()
result.display()

Result:

<snirf.pysnirf2.ValidationResult object at 0x000002C1228CAD40>

Found 3721 OK      (hidden)
Found 2061 INFO    (hidden)
Found 0 WARNING
Found 0 FATAL  

File is VALID

Any suggestion regarding this error is highly appreciated. Thanks