huppertt / nirs-toolbox

Toolbox for fNIRS analysis
86 stars 61 forks source link

Problems converting snirf to (nirs) data #19

Open DemianVera opened 1 year ago

DemianVera commented 1 year ago

Describe the bug Hi everyone! I use nirs toolbox to process my fNIRS data. Now I'm trying to open some data (BIDS) that contains data in snirf format. So I must use the nirs.io.loadSNIRF function; however, a function called snirf2data throws errors when trying to read the field SourcePos (line 60 of the present function). I think this happens because my data has the fields sourcePos3D and detectorPos3D. As I can see, this function takes that into account, but only partially. Can you help me, please? Is there any other way to load snirf data?

Steps to reproduce the behavior:

  1. Get some data in BIDS format.
  2. Try to load it using nirs.io.loadSNIRF().
  3. If the data includes 3 dimensional information about the optodes placement, wait for the error to occur.
  4. The error is that matlab can't find the field sourcePos in the snirf.nirs.probe structure, and that's because structures that have 3-dimensional information about the optodes placements use a field called sourcePos3D or detectorPos3D.

Expected behavior I expected that the line 60, where the error occurs, has a way to decide whether the structure has 3D info or not.

Thanks!

hadi71 commented 1 year ago

Hi This problem is fixed in the latest version of the toolbox. Does the problem exists? or it is fixed?