Extract surfaces from FEM, remesh and set type in matlab

Hi again,
Is there a way to programamtically:

  1. Extract the surfaces from a FEM model
    image

  2. Downsample the gray matter layer (resampe with Matlab reducepatch)
    image

  3. Set the extracted gray matter layer as "cortex" type
    image

In general, I am having difficulties in finding the corresponding functions to drop menu options that I find in the GUI and that are not available in the piepeline editor. Is there a tutorial I am missing? Or is there a function to "call back" the series of functions called from the GUI in MATLAB (something equal to "eegh" in EEGLAB )
Thank you very much for the precious support and the wonderful tool that brainstorm is!

Giacomo

Hi Giacomo,

This section addresses that topic:
https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting#Find_interface_callback_functions

E.g., The text Extract surfaces is found in the tree_callbacks.m file at line 1271:

gui_component('MenuItem', jPopup, [], 'Extract surfaces', IconLoader.ICON_FEM, [], @(h,ev)bst_call(@import_femlayers, iSubject, filenameFull, 'BSTFEM', 1));

As such, the callback for that menu is:
import_femlayers(iSubject, filenameFull, 'BSTFEM', 1);

One of our future goals is to make GUI actions to call process_ files.

Best,
Raymundo

1 Like

Great, thank you!

Giacomo