Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strings that should be scalars are arrays for multiple items in all sample files #9

Closed
kdarti opened this issue Jun 5, 2024 · 3 comments

Comments

@kdarti
Copy link

kdarti commented Jun 5, 2024

snirf spec states that /nirs/aux/name strings should be stored as scalars, the same goes for each item under metadatatags
e.g

image

image

2nd dim always equals number of characters in string.

@kdarti
Copy link
Author

kdarti commented Jun 5, 2024

Actually, it's not only strings, also for other data types there is the same issue.

@fangq fangq closed this as completed in 3a8505f Jun 6, 2024
@fangq
Copy link
Member

fangq commented Jun 6, 2024

@kdarti, these example files were produced before the SNIRF spec was fully refined and the validator was developed.

They are currently produced by a general purpose HDF5 reader/writer I wrote for matlab (EasyH5), but EasyH5 handles general data arrays, and is not particularly validating/restricting specific data types in SNIRF fields. The SNIRF-specific data types are supposed to be reinforced in the jsnirfy toolbox .

last year, I made the following commits in jsnirfy toolbox to force array-shaped strings to variable-length string (scalar type)

NeuroJSON/jsnirfy@95db007

but I did not rebuild the sample files. I just committed an updated .snirf files regenerated using the latest easyh5 and jsnirfy toolboxes. the string variables are now scalars. please verify.

@kdarti
Copy link
Author

kdarti commented Jun 7, 2024

Thanks, all are scalars now! And thanks for the explanation about jsnirf.

Btw, to avoid making a new issue, I noticed that source and detectorlabels are implemented in this way in the .snirf sample files:
image

From my reading of snirf specs this seems incorrect, so probably also a result of making files before spec.

image

However, in the jsnirf samples it looks like this:

		"sourceLabels": [
				"S1",
				"S2",
				"S3",
				"S4"
			]

https://github.com/fNIRS/snirf-samples/blob/3a8505f19a21749bd35f37d8ac988d5e75ca1047/basic/neuro_run01.jnirs#L20805-L20810

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants