-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
SNIRF import ignores timeUnit field contrary to specification #10538
Comments
Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽♂️ |
ping @rob-luke |
@samuelpowell is correct. I will discuss with him today how we can fix this and get a test file. In general, the SNIRF specification is very large, and MNE only covers a small amount of what can be stored. I have been taking a pragmatic approach and just ensuring we can read data from all the manafacturers. But I will take more care in future PRs to add some defensive programming and throwing some more warnings. |
Sample file posted in connected issue. Sample rate in this file is 6.67 Hz (e.g. the time vector is [0, 150] ms). |
@rob-luke please note that the sample file I provided included events ( |
That's madness from the spec. So your data could be in ms and your stim times would be in s? Crazy. |
Indeed so, I will open an issue but this is a breaking change. Note that I'm away until Thursday but will pick up on everything promised when I return. |
@rob-luke I attach a pair of smaller sample files. The recordings were made using only three tiles (216 channels) in an eighteen tile cap (10Hz output data rate), include landmarks and sample events, and were converted using version 1.1 of our conversation package. There are two files included which have some small differences which we have previously discussed.
At present, only the latter will load in MNE-NIRS, as the former will result in a The current problems are:
|
Describe the bug
When importing SNIRF data, the
timeUnit
field is ignored and seconds are silently assumed when computing the sampling frequency of the input data. This is contrary to the specification.The consequence is that the computed sample rate may be incorrect.
Cause
Rather than demonstrate reproduction, one can observe the cause of this behaviour in the codebase, which makes no reference to
timeUnit
and computes the sampling rate assuming seconds. From master:Expected results
Either:
timeUnit
is both present and not equal to 's', or,Actual results
The
timeUnit
is silently ignored and the resulting sampling frequency is incorrect.Additional information
Error present on master.
The text was updated successfully, but these errors were encountered: