-
Notifications
You must be signed in to change notification settings - Fork 41
ValueError rdm1 and rdm2 have different nan positions #347
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
Comments
hi jiesong, |
Did you manage to figure out where went wrong here? I have the same issue. It happens on some subjects data but not others. I did exclude all the zero/nan time series when creating the centers and neighbors. |
hi @JasperVanDenBosch , I was wordering if there is any update on how to fix this issue? I got the same error when performing a between subject rsa serachlight using contrast maps generated from spm12. I looked into the SL_RDM.dissimilarities and found the rdms of the searchlights where the error occured during evaluate_models_searchlight did contain several na values. However I had masked the data so that for each map, all the values within the mask are equal to or above 0 and those outside are nan. I truly appreciate any guidance or advice you can provide! |
hi @kkkkkly , |
Thank you so much for your quick reply! I tried to changed the 0s to 0.001s but the problem was still there. However, under your inspiration, I then changed the distance measures from 'correlation' to 'euclidean' and it worked this time!I'm really grateful for your help. looking forward to the new version of rsatoolbox and wishing you all the best!
…---- Replied Message ----
From
Jasper J.F. van den ***@***.***>
Date
11/8/2024 00:55
To
***@***.***>
Cc
***@***.***>
,
***@***.***>
Subject
Re: [rsagroup/rsatoolbox] ValueError rdm1 and rdm2 have different nan positions (Issue #347)
hi @JasperVanDenBosch , Thank you for developing rsatoolbox! It is very handy and the online manuals are very helpful to newcomers like me.
I was wordering if there is any update on how to fix this issue? I got the same error when performing a between subject rsa serachlight using contrast maps generated from spm12. I looked into the SL_RDM.dissimilarities and found the rdms of the searchlights where the error occured during evaluate_models_searchlight did contain several na values. However I had masked the data so that for each map, all the values within the mask are equal to or above 0 and those outside are nan.
I truly appreciate any guidance or advice you can provide!
hi @kkkkkly ,
Glad that rsatoolbox is helpful to you You mention some voxels being equal to 0. Some distance measures don't do well with all-zero patterns. This may be the cause of the NaNs. I'd recommend including these voxels in the mask.
If this is not the cause, you're welcome to send me a data sample and code to look at. Generally speaking we are not actively maintaining the searchlight code, since over the next few months we are planning to revamp this module entirely. Hope this helps..
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Thank you all so much for developing the RSAtoolbox. I am trying to run Searchlight on my own data, but encountering some errors.
When I run the pipeline with the demo data, everything works smoothly. However, when I tried to input the z maps that I got from the first-level GLM analysis on Nilearn. The code showed an error:
Exception has occurred: ValueError rdm1 and rdm2 have different nan positions File "C:\Jie_Documents\Navigation\Script\RSA\RSAtoolbox.py", line 112, in eval_results = evaluate_models_searchlight(SL_RDM, an_model, eval_fixed, method='spearman', n_jobs=3) ValueError: rdm1 and rdm2 have different nan positions
I tried t-maps, z-maps, and beta-maps, all showed this error. I also tried your demo data but with the spmT maps, the same error here. Do you have any ideas on how to deal with it? Do we need to do something before we input the data? I could supply 1-2 subjects of my data for your consideration if you need it.
thank you so much if you could give some suggestions on it!!
The text was updated successfully, but these errors were encountered: