Homer3 icon indicating copy to clipboard operation
Homer3 copied to clipboard

[BUG]: Incorrectly determining the length of auxiliary time series data leads to loading errors.

Open nidadu opened this issue 1 year ago • 0 comments

Version of Homer3 you are using

Homer3, v1.80.2

Your environment (MATLAB environment and OS)

OS and MATLAB independent

Description of the issue

Homer3 assumes that the number of time points is greater than the number of channels. This is not always the case, especially using high density data. As a consequence, Homer3 fails to load some high density data. This issue has been addressed before (https://github.com/BUNPC/Homer3/issues/79) but was not fully fixed.

Homer3 checks the time series when loading aux data. If the channel count is greater than the number of time points, length(dataTimeSeries) will return the channel count instead of the time count. Thus, the code will throw an error and the aux data will be incorrectly rejected.

https://github.com/BUNPC/Homer3/blob/666ab6d0b054e9b2eb829d62736aaa2148638f67/DataTree/AcquiredData/Snirf/AuxClass.m#L261-L263

Steps to reproduce: Attempt to load a SNIRF file where the channel count is greater than the number of time points.

Expected behavior: Load without error.

Actual behavior: Homer3 indicates an error (-4) claiming "aux" field is invalid and could not be loaded. The aux data is not loaded.

nidadu avatar Nov 15 '23 11:11 nidadu