Import information from Brainstorm

Hello,
I want to run this code and extract data from Brainstorm, but I'm not exactly sure where to get this information from. Could you please help me?
This code:

[sStudy, iStudy] = bst_get('StudyWithCondition','Subject01/Test');% import from brainstorm
index = 1;
bst_call(@export_matlab, {char(sStudy.Data(1,index).FileName)},'data');

%=======================Import the LFM and Cortex==================================%
[sSurface, iSurface] = bst_get('SurfaceFileByType',[],'Cortex');
bst_call(@export_matlab, {char(sSurface.FileName)},'Cortex');
Atlas = Cortex.Atlas(2);
[sHeadModel] = bst_get('HeadModelForStudy', iStudy);
bst_call(@export_matlab, {char(sHeadModel.FileName)},'model');

Thank you for your guidance!

Hi @tara70, you can find information about scripting in Brainstorm in this tutorial:

https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting

This code:

  1. Exports as Matlab variables an imported recording from the Subject Subject01 and Study Test, and the HeadModel in same study.

  2. It also exports as Matlab variables the Default Cortex for the Default anatomy Subject

The script will only run for the Protocol that was written for