fNIRS / snirf

SNIRF Format Specification
http://fnirs.org/resources/software/snirf/
Other
57 stars 33 forks source link

Contradictory array sizing in time vector #108

Closed samuelpowell closed 2 years ago

samuelpowell commented 2 years ago

It is specified that for "the special case of equal sample spacing a shorthand <2x1> array is allowed" for the /nirs(i)/data(j)/time dataset (and other time vectors). However the type of this field is "numeric 1-D array", and it is also specified a "SNIRF field specified by this document as a numeric 1-D array must occupy a dataspace with rank of 1".

Evidently this is contradictory. Should this text perhaps read, e.g., "For the special case of equal sample spacing, an array of length 2 is allowed where ..." ?

sstucker commented 2 years ago

Ugh, I wasn't even aware of this feature. I need to add an exception in my validator for this as well.

Do column vectors appear anywhere else? Let's amend it the way you suggest, although this would be breaking (hopefully for very few)

samuelpowell commented 2 years ago

Thanks @sstucker. Given the specified general requirements for array dimensionality, I suspect if anyone is using this format for the time vector they would have just used a rank-1 array anaway.

I've only found this in /nirs(i)/data(j)/time, and /nirs(i)/aux(j)/time.

I'll open a PR shortly.

samuelpowell commented 2 years ago

Singleton dimension also exists in the definition of