mne-tools / mne-tools/mne-python
Snirf files not readable
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 1.6k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 100
Description
Hi,
I am creating snirf files with pysnirf2 based on data collected with LSL in xdf format.
I then want to preprocess the data in the snirf files with MNE.
If I create the snirf files, the nirs group is an indexed group. So the key will be 'nirs1' as indexing starts with 1 in h5py, I believe.
In the snirf documentation (https://github.com/fNIRS/snirf/blob/master/snirf_specification.md#nirsiprobesourcepos2d)
the nirs group should also be an indexed group.
In Homer3 the created snirf files are readable.
However, with MNE I get an error that the file does not have the nirs element. This is expected as it searches for 'nirs' as a key but the key is actually 'nirs1'.
KeyError: "Unable to open object (object 'nirs' doesn't exist)"
And opening with h5py:
<KeysViewHDF5 ['nirs1']>
My question is, if anyone has any suggestions how to fix this or if there is an quick fix for my problem so that I can actually use my files in MNE?
Another question is, how to generally handle the nirs group. As far as I understand the snirf format is based on hdf5 format and indexing generally starts at 1? Snirf files created with the aurora directly use 'nirs' as a key. Is there any standard which way it should be?
I also attached the file.
subj3_mt_loc.snirf.zip
Thanks,
Carla
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the error with the attached subj3_mt_loc.snirf.zip file and inspecting its HDF5 keys with h5py. Read the MNE SNIRF-loading entry point where the nirs element is sought, then verify that the affected file can be opened and preprocessed without the KeyError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100