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

ValueError: cannot convert float NaN to integer #54

Open
nbounoua opened this issue Oct 21, 2021 · 3 comments
Open

ValueError: cannot convert float NaN to integer #54

nbounoua opened this issue Oct 21, 2021 · 3 comments

Comments

@nbounoua
Copy link

nbounoua commented Oct 21, 2021

Hello,
I wanted to follow-up on this issue we are having with some of our participants. We looked further into our data, and at least some of the cases where we are getting NaNs appears to be because one or more of the estimated motion parameter columns are all 0, so it's trying to correlate with a constant. Do you have suggestions on what we can do about this? As a short term solution, would be ok to replace the 0 columns with one of the non-0 columns?

@nbounoua
Copy link
Author

Hi, Just wanted to bring this back to your attention. Thanks for the help!

@maartenmennes
Copy link
Owner

Hi, I would be worried by motion parameter columns being exactly 0... Has this data been motion corrected (and realigned) before? Rather than a temporary fix, I would look into the origin of these values, as this is not expected with typical data (unless you're scanning fixed objects)...

@nbounoua
Copy link
Author

nbounoua commented Nov 4, 2021

Hi,
Thank you for your response!

We wondered the same thing and checked into it, but it doesn't seem to be an error. Specifically, (i) the motion corrected data looks reasonable, (ii) we only see it for people who move very little, and we don't see it in samples that overall move more (i.e., adolescents), (iii) the nan error is happening for people who don't have actually have all 0's - b/c they sample only 90% of the timepoints, there are people who have a few non-0 timepoints who are also showing the nan error, and (iv) the (near) constant columns are always the y (and sometimes z) rotation columns, which is the least likely to move, given the way we pack people in.

If this is the case, is the proposed solution is ok and is there a way to update the code so that it would ignore nans for these correlations with motion parameters?

Thank you for the help!

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