help > RE: Problem with WFU PickAtlas Results Viewer
Nov 17, 2025  06:11 AM | Yoshikazu Nakano
RE: Problem with WFU PickAtlas Results Viewer

Hi huilee92 and scchester,


I just encountered exactly the same error with WFU_PickAtlas “Results Viewer” under SPM12 + MATLAB R2024a:





 



Using SPM8_lite, adding (spm_lite) to path.
Warning: Name is nonexistent or not a directory: …/spm_lite

ERROR │ wfu_results_defaults │ Line 0052: Array dimensions must agree.


From extensive debugging I found the cause: in wfu_results_defaults.m, around line 46-53 the code does:





 



hind = find(h >= 0);
vind = find(v >= 0);
screenIndex = min(find(hind == vind));


In MATLAB R2024a (and in some multi-monitor setups) the vectors hind and vind may differ in length, so hind==vind leads to the “Array dimensions must agree” error.


Fix: replace that block with something like





 



idx = intersect(hind, vind);
if isempty(idx)
screenIndex = 1;
else
screenIndex = idx(1);
end


After applying this patch and restarting MATLAB, the Results Viewer now works correctly in my setup.


If you like, I can share the full patched wfu_results_defaults.m and my version details (MATLAB R2024a, SPM12 r7771, PickAtlas 3.0.5b).


Note: If you're searching for wfu_results_defaults.m: it's located in .../wfu_results/private/ — being under a private/ folder, it won't show up using which or edit unless called from the parent function.


 


Hope this helps you too!


Best wishes,


Yoshikazu Nakano

Threaded View

TitleAuthorDate
huilee92 Apr 23, 2018
RE: Problem with WFU PickAtlas Results Viewer
Yoshikazu Nakano Nov 17, 2025
scchester Jun 16, 2021