How to use the code on brainstorm in the matlab

hello everyone!!
I want to ask. After I finished inverse,I looked for the maximum value of my signal in 250ms in mri(as the fig).I want to use code on matlab to do it. What should i do?


112402

If you want to find the value of the maximum in the file, use the process "Extract > Find maximum in time".

If you want to get the coordinates of the maximum, you need to script it: read the source file, search ImageGridAmp for the row with the maximum value, then find the coordinates in the Vertices of cortex surface file (surface source model), or the GridLoc field of the source file (for a volume source model).
Start by reading the Scripting tutorial:
https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting

If you want to show exactly what you have your screen: open the source file with the MRI viewer with function view_mri.m with the source file as the OverlayFile. Read the header of the function for help.
Then execute something similar to the contents of the function JumpMaximum, which is executed when you click on the popup menu Find maximum: