Problem with BST FIGURE while visualizing fieldtrip source stats

Hello everyone;
I am getting a very strange message from the bst figure function, something I have never seen before.

In brief, what I did was to run a simple ft_sourcestatistics between two sets of images (18 in process 1 and 18 in process 2). The stats ran fine, but when I try to load the image, the figure pops up but I can't "scroll" across time (i.e., as soon as I hit the move forward button to look at the temporal dynamics this error pops up on Matlab).

This issue does not show if I try to redo the same but running the t test or parametric stat functions of brainstorm, but only after using Process 1 and 2 with fieldtrip function.

Index in position 2 exceeds array bounds (must not exceed 1).

Error in panel_surface>UpdateSurfaceData (line 1436)
mask = mask | sClusters(iClust).mask(:, iTime, :);

Error in panel_surface (line 38)
eval(macro_method);

Error in bst_figures>FireCurrentTimeChanged (line 909)
panel_surface('UpdateSurfaceData', sFig.hFigure);

Error in bst_figures (line 59)
eval(macro_method);

Error in panel_time>SetCurrentTime (line 243)
bst_figures('FireCurrentTimeChanged', ForceTime);

Error in panel_time>TimeKeyCallback (line 385)
case 'pageup', SetCurrentTime(CurrentTime + 10 * SamplingRate);

Error in panel_time>@(h,ev)TimeKeyCallback('pageup') (line 60)
jButtonTime(5) = gui_component('button', jPanelNew, '', '>>', [], [], @(h,ev)TimeKeyCallback('pageup'));

Any Idea?
Thanks!

Probably something in the dimensions of your data that is not handled correctly by the display functions.
Can you try to package an example dataset, so I can fix it?

  • Duplicate the subject where you have the file you cannot open (right-click on subject > Duplicate subject)
  • Delete all the files that are not needed to replicate the issue (keep at least the channel file, forward model and source-level stat - delete the high-resolution cortex surfaces and ASEG atlas)
  • Export the subject as a .zip file (right-click on subject > File > Export subject)
  • Upload it somewhere and post the download link here (or as private message if it sensitive data)

Thanks
Francois

1 Like

Thanks Francois for the prompt reply;
It was the weirdest of the cases, so I ran again the exact same ft_sorucestatistic function (but from another computer) and it worked just fine (about 18 hours process).
I will keep re-run all the stats I did on this dataset (about 12 cluster corrected analyses) and let you know if this comes up again;

If you still want, I can compress the files and dropbox them to you.

Best,

I guess you did something different between the two computers...
This doesn't look like the kind of error that would be different across platforms (but this is just intuition).

Yes, please package your files and send them to me.
You can also try to copy the zipped subject to your second computer and load it with: File > Load protocol > Import subject from zip.
If you get the same error, it's not only a display error, it's also that in your second attempt you computed something different.

Dear Francois,
I have also experienced similar problem.
After I computed the PLV between left temporal and the rest of the network at source level, I used ft_sourcestatistics to analyze the PLV results of two groups.
The stats worked well, but when I try to load the image, the figure doesn’t pops up.
I got the following error report:
图片22
My matlab version is R2019b and the Brainstorm version is 13-May-2021.
What should I do to solve it? I will appreciate very much with your any opinions.
Best,
Han Xiaoke

I guess there is nothing significant in your file, I don't think I can help you with your results.
But I'd like to capture this error correctly. Could you please share this file with me, so I can reproduce this error on my end?

  • Right-click on the subject > File > Duplicate subject
  • In the anatomy view: delete all the files expect the MRI, the head surface and the cortex surface you used for source estimation.
  • In the functional view: delete all the files expect the channel file and the stat file with which you are having this error
  • Double-click on your file in the duplicated subject and make sure that you still get the exact same error
  • Right-click on the subject > File > Export subject
  • Upload the .zip file somewhere and post the download link here

Thanks

Dear Francois,
I just uploaded the protocol to Google cloud disk. You can download it at the following link:
https://drive.google.com/drive/folders/1gWjFQMOKS1lfCK41eLtnok9-6bpwpIeV?usp=sharing
If there is any problem with the data, please don't hesitate to contact me.
Thank you for all your efforts on this matter.
Best,
Han Xiaoke

I'm a bit confused with the files you set: I asked you to share only the file with the problem and you sent the entire protocol.
Anyway, I tried to double-click on all the files in your protocol and they all load correctly with different versions of Matlab, from 2015b to 2021a.

  • Reload your protocol
  • Make sure you don't have any other toolbox interfering in your environment. Follow these instructions precisely: edit your Matlab path, remove all the folders that do not belong to the very Matlab installation, save the path, close and restart Matlab, start Brainstorm without adding it to the path.

Dear Francois,

I'm sorry for my fault in uploading data which brought you some troubles.
I'm new to brainstrom and not very familiar with some of the processes. To ensure that you can reproduce this error, I uploaded the entire protocol...

The file ( FT t-test unequal cluster [-3.000s,3.000s]: sub01/PLV: temporalpole L (2) vs. sub02/PLV: temporalpole L (2) ) I cannot open is in the “Group analysis”, So maybe I just need to duplicate “group analysis”?

I have update brainstorm version to 18-may-2021. I have also reloaded the file in accordance with your instructions precisely, but unfortunately, I still receive the error report.

In MATLAB 2013b, the error message is:


Error: Line 1731: Index exceeds matrix dimensions.
Call stack:
panel_surface.m>UpdateSurfaceData at 1731
panel_surface.m>SetSurfaceData at 1515
panel_surface.m at 40
view_surface_data.m at 298
tree_callbacks.m at 365
bst_call.m at 28
panel_protocols.m>CreatePanel/protocolTreeClicked_Callback at 123
bst_call.m at 28
panel_protocols.m>@(h,ev)bst_call(@protocolTreeClicked_Callback,h,ev) at 73


In MATLAB 2019b, the error message is:


Error: Line 1731: Index in position 2 exceeds array bounds (must not exceed 1).
Call stack:
panel_surface.m>UpdateSurfaceData at 1731
panel_surface.m>SetSurfaceData at 1515
panel_surface.m at 40
view_surface_data.m at 298
tree_callbacks.m at 365
bst_call.m at 28
panel_protocols.m>CreatePanel/protocolTreeClicked_Callback at 123
bst_call.m at 28
panel_protocols.m>@(h,ev)bst_call(@protocolTreeClicked_Callback,h,ev) at 73


Won't these error messages be displayed in your computer?

I uploaded the data again, You can download it at the following link:

https://drive.google.com/file/d/1SRbbtS1Hf7PHCMZnb0MUAQ4pf-zW40j8/view?usp=sharing

I would like to apologize once again for my negligence :pleading_face:.
Thanks for all your help.
Best,
Han Xiaoke

I found out that this is not a problem of Matlab version, but a combination of inputs that I had not tested.
I added an extra test for the files with no time dimension: https://github.com/brainstorm-tools/brainstorm3/commit/49ffea3f86d7cddbcbd765a670fe76626c076b65

Please update Braintorm and try again, it should fix your error.

Dear Francois,
Now it can dispaly normally :grinning:!!
Thank you, Francois!
Best,
Han Xianke