mne-tools / mne-tools/mne-python

snirf import - source or detector position

Open
#10,975 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

BUG
Dominant language
Python
Stars
3.5k
Forks
1.6k
Avg merge
1d 6h
Merged PRs (30d)
100

Description

Describe the bug

The import of snirf data from an Artinis-portalite device cause an assert error.
The device have 3 sources but only one detector which leads to a 2D position format error.

Expected results

in RawSNIRF class code:

detPos2D = np.array(dat.get('nirs/probe/detectorPos2D'))

shape of detPos2D:

detPos2D.shape --> (2,)
len(detPos2D.shape) --> 1
Solution
  1. for oxy4 file directly converted in snirf : correction of detPos2D to be able to create detPos3D
detPos2D = np.array(dat.get('nirs/probe/detectorPos2D'))
if len(detPos2D.shape) == 1:
> detPos2D = detPos2D.reshape(len(detectors), 2)
  1. for oxy4 file converted in nirs then in snirf : correction of detPos3D
if len(detectors) != detPos3D.shape[0]:
> detPos3D = detPos3D.T   
> assert len(detectors) == detPos3D.shape[0]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the RawSNIRF class and reproducing the import with Artinis Portalite SNIRF or oxy4-converted data. Check the detectorPos2D and detPos3D shapes against the detector count along both conversion paths. Done means the import handles the single-detector layout without the assertion error.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.