SNIRF loader not working with the official samples
See original GitHub issueDescribe the bug
The function read_raw_snirf returns errors with the official samples from https://github.com/fNIRS/snirf-samples/.
Steps to reproduce
With Simple_Probe.snirf:
from mne.io import read_raw_snirf
snirf_intensity = read_raw_snirf('Simple_Probe.snirf')
With minimum_example.snirf:
from mne.io import read_raw_snirf
snirf_intensity = read_raw_snirf('minimum_example.snirf')
Expected results
Loading Simple_Probe.snirf
and
Loading minimum_example.snirf
respectively.
Actual results
Loading Simple_Probe.snirf
...\snirf.py:3: RuntimeWarning: Non uniform sampled data not supported.
snirf_intensity = read_raw_snirf('Simple_Probe.snirf')
...\snirf.py:3: RuntimeWarning: Unable to extract sample rate from SNIRF file.
snirf_intensity = read_raw_snirf('Simple_Probe.snirf')
Traceback (most recent call last):
File "...\snirf.py", line 3, in <module>
snirf_intensity = read_raw_snirf('Simple_Probe.snirf')
File "...\mne-python\mne\io\snirf\_snirf.py", line 43, in read_raw_snirf
return RawSNIRF(fname, preload, verbose)
File "<decorator-gen-248>", line 24, in __init__
File "...\mne-python\mne\io\snirf\_snirf.py", line 112, in __init__
sources = [s.decode('UTF-8') for s in sources]
File "...\mne-python\mne\io\snirf\_snirf.py", line 112, in <listcomp>
sources = [s.decode('UTF-8') for s in sources]
AttributeError: 'numpy.ndarray' object has no attribute 'decode'
and
Loading minimum_example.snirf
...\snirf.py:3: RuntimeWarning: Non uniform sampled data not supported.
snirf_intensity = read_raw_snirf('minimum_example.snirf')
...\snirf.py:3: RuntimeWarning: Unable to extract sample rate from SNIRF file.
snirf_intensity = read_raw_snirf('minimum_example.snirf')
Traceback (most recent call last):
File "...\snirf.py", line 3, in <module>
snirf_intensity = read_raw_snirf('minimum_example.snirf')
File "...\mne-python\mne\io\snirf\_snirf.py", line 43, in read_raw_snirf
return RawSNIRF(fname, preload, verbose)
File "<decorator-gen-248>", line 24, in __init__
File "...\mne-python\mne\io\snirf\_snirf.py", line 112, in __init__
sources = [s.decode('UTF-8') for s in sources]
TypeError: iteration over a 0-d array
respectively.
Additional information
This tutorial from MNE-NIRS works fine on my machine.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
fNIRS/snirf-samples: Sample SNIRF datasets - GitHub
SNIRF Sample Data Files · SNIRF files · JSNIRF/JSON files · Binary JSNIRF files · How to access individual data records in Python....
Read more >Importing Data From fNIRS Devices - MNE-Python
fNIRS measurements may be stored in a non-standardised format that is not supported by MNE-Python and cannot be converted easily into SNIRF. This...
Read more >Issues with read_raw_snirf imported from NIRTOOLBOX
I've been working until now on my nirs data with the Matlab nirs toolbox but it is ... But if the file is...
Read more >editing .snirf files – Homer3 and AtlasViewer – openfnirs Forum
How do you typically open .snirf files to edit them in matlab not using the ... After loading a snirf file, I'd like...
Read more >Swagger not loading - Failed to load API definition: Fetch error ...
Very strange requirement. The new path works fine in local debug and on the server. Seems like it would be the default from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just received some SNIRF files from NIRx. So I will test and ensure these load in to our reader.
That’s good to know. Thanks for checking this. I probably wouldn’t trust that validator either. Just the spec is valid