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]: hmrR_MotionCorrectSpline throws an error when nirs/datax/dataTimeSeries or nirs/datax/time is stored as 32bit #190

Open
kdarti opened this issue Dec 15, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@kdarti
Copy link

kdarti commented Dec 15, 2023

Version of Homer3 you are using

1.80.2

Your environment (MATLAB environment and OS)

2017b runtime

Description of the issue

image

Given the error I figured it was due to 32bit data in dataTimeSeries / time and indeed, resampling the data to 64bit and the error is gone. I've attached the original, and the resampled file in the next section.

Steps to reproduce:

8001_00_24217_resampled.zip
8001_00_24217_original.zip

Expected behavior:

hmrR_MotionCorrectSpline shouldn't throw an error becuase dataTimeSeries is stored as 32bit, I validated the file with pysnirf2, and the snirf spec doesn't enforce 64bit storage:

image

Actual behavior:
Error if dataTimeSeries is in 32 bit format

@kdarti kdarti added the bug Something isn't working label Dec 15, 2023
@kdarti
Copy link
Author

kdarti commented Dec 15, 2023

Note that this is enough enough to fix by casting t and dod to double, but not sure how you prefer to solve it.

Also, the issue is with csaps on this line:

SplInterp = csaps(t(lst)', dod(lst,idx_ch)', p, t(lst)')';

@kdarti kdarti changed the title [BUG]: hmrR_MotionCorrectSpline throws an error when nirs/datax/dataTimeSeries is stored as 32bit [BUG]: hmrR_MotionCorrectSpline throws an error when nirs/datax/dataTimeSeries or nirs/datax/time is stored as 32bit Dec 15, 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