TDT:searchlight_warnings and decoding statistics_error

Hello Everyone
I am currently working on fMRI data analysis using the TDT toolbox. Specifically, I am conducting SVR searchlight MVPA on the beta values extracted from the whole brain of 24 participants.

During the searchlight analysis, I encountered warnings in MATLAB, such as:


searchlight: 56000/185405, time to go: 00:09:15, time running: 00:04:02, finish: 2024/01/03 17:43:26
warnings: decoding_transform_results.m tried to calculate the output measure cfg.results.output='corr' and returned nan. This might be because one part of your data (e.g. a voxel value) is nan.

These warnings result in most of the values in ‘results.corr.output’ being NaN, while the remaining values are 1. I am puzzled by this issue as the original data’s beta values for each voxel in the whole brain are not NaN. Interestingly, when I increased the number of participants to 31 and reran the searchlight MVPA, no such warnings appeared, and the results in ‘results.corr.output’ were normal without NaN values. I am unsure about the cause of this discrepancy and would appreciate any insights you may have.

The second issue pertains to the ‘decoding statistics.m’ function. After completing 1000 permutation tests, I encountered the following error during decoding statistics:


**Undefined function or variable 'nanind'**
**ERROR decoding statistics (line 268)**
**p(nanind) = NaN**

Although the script continues to run if I skip line 268, the resulting ‘stats_corr_permutation_z_right.nii’ image cannot be read. I am uncertain about the appropriate resolution for this error and would be grateful for any guidance you can provide.

Hi JianfengZhou,

I don’t know what exactly could be the issue but NaN should only really appear if there is zero variance (and ensuing divide by zero). Increasing the number of participants could lead to this no longer being the case.

What you could do is the following:

  1. in the command line, call decoding_defaults;
  2. Then type edit decoding_transform_results
  3. Then, set a breakpoint on line number 232 by clicking on the number

When the warning is called for the first time, put the following into the command line
a. decoding_out(i_step).predicted_labels
b. decoding_out(i_step).true_labels

You can exit debug mode by removing the breakpoint and typing dbquit into the command line.

Regarding decoding statistics: Unfortunately, this is only meant for accuracy since valid permutations with continuous values are a bit more complicated. It’s possible to change the function to do this but not something I can implement very quickly.

Best wishes,
Martin

thanks for your replies and guidance.