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

[BUG]: Origin/delta time vector in compliant SNIRF data is unsupported #180

Open
samuelpowell opened this issue Jun 16, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@samuelpowell
Copy link

Version of Homer3 you are using

v1.80.2 & master

Your environment (MATLAB environment and OS)

OS and MATLAB independent

Description of the issue

The SNIRF specification allows for the time vector to be either equal in length to the associated data time series, or to be of length two, containing the start time and the sample time spacing.

/nirs(i)/data(j)/time

Presence: required
Type: numeric 1-D array
Location: /nirs(i)/data(j)/time

The time variable. This provides the acquisition time of the measurement relative to the time origin. This will usually be a straight line with slope equal to the acquisition frequency, but does not need to be equal spacing. For the special case of equal sample spacing an array of length <2> is allowed where the first entry is the start time and the second entry is the sample time spacing in TimeUnit specified in the metaDataTags. The default time unit is in second ("s"). For example, a time spacing of 0.2 (s) indicates a sampling rate of 5 Hz.

Option 1 - The size of this variable is and corresponds to the sample time of every data point
Option 2- The size of this variable is <2> and corresponds to the start time and sample spacing.

However, when loading the data, Homer3 asserts that the time vector corresponds only to option one of the specification, as can be seen here:

if size(obj.dataTimeSeries,1) ~= length(obj.time)
err = -3;
end

As such, Homer3 throws an error when loading standards compliant SNIRF files.

(debugged by @ernesto-vidal)

Steps to reproduce:
Attempt to load a SNIRF file with a time vector of length two, corresponding to option two of the SNIRF specification for this field.

Expected behavior:
A standards compliant implementation will extrapolate the time series based upon the initial time series and delta.

Actual behavior:
Homer3 indicates an error (-3) and does not load the data.

@samuelpowell samuelpowell added the bug Something isn't working label Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant