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

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

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

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!


Hi Giacomo,

This section addresses that topic:

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.


1 Like

Great, thank you!