New error in bst_process('CallProcess', 'process_channel_addloc', sFiles, [],

Hi everyone,

I'm getting a new error in my pipeline related to adding channel locations. The script worked great in March, but now getting an error related to dot indexing not supported for variables of this type.

I had to delete and re-install my brainstorm into a different folder on my university virtual environment due to space issues, but I can't think of other reasons this would occur.

Has anything changed with the bst_process function that could account for this?

I know this is a pretty vague error and I was hesitant to post, but I've now spent hours trying to make progress on my own and I'm stumped. Hopefully it is something stupid I'm doing that is easy to adjust.

Thanks everyone,


Dot indexing is not supported for variables of this type.
Error in bst_process>Run (line 285)
        allStudies = bst_get('Study', unique([sInputs.iStudy]));
Error in bst_process>CallProcess (line 2316)
        OutputFiles = Run(sProcess, sInputs, sInputs2, 0);
Error in bst_process (line 38)
Error in brainstorm_epoch_031424_attempts061424 (line 57)
sFiles = bst_process('CallProcess', 'process_channel_addloc', sFiles, [], ... 

brainstorm_epoch_031424_attempts061424.m (6.1 KB)

From a quick gaze, the pipeline looks good.

No, it has not changed.

As debugging, try printing sFiles after each process.

thanks Raymundo!

it looks like when I (think I'm) importing MRI, the sfile is empty. is that normal?

Here are sfiles after importing, after eeglink, and after importing epoched data


Yes, that is normal as importing MRI, does not return a functional file

What's the output of the calling the process process_import_data_epoch?
If you do the same steps in the GUI, do you get an error message?

So in the GUI it works fine.

But, when I comment out the importing existing epochs, the pipeline works!

here is the sfiles after actually trying to import existing epochs

Can you describe which steps are preformed in the GUI?

Would it be possible for you to share a sample file that causes the issue?
Upload the file somewhere and post the download link here, or send it to me as DM

Thanks Raymundo. Links below. I think i figured it out.

The "ICBM152: ANT Waveguard 64" option is the only eeg position option that does not seem to work.

Other comparables, including "ICBM152: ANT Waveguard 64 duke" do not produce an error.

Further, when I add a space after the title, e.g., "ICBM152: ANT Waveguard 64 ", it also works without an error.

Is it possible this is the source of the error?

Thanks again Raymundo!

TB2_002_Rain_P1V11_T999_epoch_357dot_1.set - Google Drive, TB2_002_Rain_P1V11_T999_epoch_357dot_1.fdt - Google Drive

That is strange.

Could it be that you have changed the file name of the file that contains that specific channel file, in
either of these folders?

  1. /brainstorm3/defaults/eeg/ICBM152 or

  2. ~/.brainstorm/defaults/eeg/ICBM152
    (it may not exist if you have not added custom default channel files)

You can check the valid default channel files to detect the error as follows:

  1. With Brainstorm running, execute this command in Matlab:
    bstDefaults = bst_get('EegDefaults');

  2. Check the contents of that correspond to the ICBM512 files, and verify the name and filepath of the ANT Waveguard 64. Does it have an space in it?

so strange!

  1. in the folder, it looks like it is correctly labeled (i.e., there is no extra " ")

  2. you are right, it doesn't exist as I haven't added custom default channel files.

3/4. it looks correct here too:

But, if I call it "ANT Waveguard 64" instead of "ICMB: ANT Waveguard 64", which was what it was labelled in process, it seems to work!

I'm testing it more now, but maybe?

Please note that the file path in your figures do not check. So, you may be checking different folders.

The ICBM512 is needed as this means that the channel positions are already set for that anatomy.

yes, sorry for confusion, same folder just can be different paths. here is another screen shot with aligned paths.

Okay, so ICBM512 is needed. is "ICBM512: ANT Waveguard 64" the wrong label to use?

Is there another label? Or woudl it be fine to call the channel path in the line above like this?

sFiles = bst_process('CallProcess', 'process_channel_addloc', sFiles, [], ...
    'channelfile', {'/oscar/data/lcarpent/bkavanau/brainstorm3/defaults/eeg/ICBM152/channel_ANT_Waveguard_64.mat', '4D'}, ...
    'usedefault',  '', ...  % ICBM152: ANT Waveguard 64
    'fixunits',    1, ...
    'vox2ras',     0, ...
    'mrifile',     {'', ''}, ...
    'fiducials',   []);

that did not seem to work. while the script did not stop due to errors, the report gave an error:

It gives an error, as it expects a 4D (4D-Neuroimaging) format.

You need to select: 'BST' (Brainstorm) as format for the channel file.

Okay shoot. that causes it to go back to the original dot indexing error.

It works with ICBM: ANT Waveguard 64 duke. Can I just use that channel file? I don't know the difference between regular and "duke".

I only originally selected ANT Waveguard because the EEG was recording on ANT 64 channel, but maybe there is something in my data structure that is incompatible with the regular 64 option?

The confusing part is that it worked without issue the last time I opened brainstorm in march.

Thanks so much Raymundo!

Could it the channel file ICBM152/channel_ANT_Waveguard_64.mat' was modified?

  1. Download that file from the GitHub repository:
    brainstorm3/defaults/eeg/ICBM152/channel_ANT_Waveguard_64.mat at master · brainstorm-tools/brainstorm3 · GitHub

  2. Copy and paste it to replace brainstorm3/defaults/eeg/ICBM152/channel_ANT_Waveguard_64.mat'

  3. Try again

Hi Raymundo,

I thought that too. But replacing the file, as well as completely uninstalling and then re-installing, didn't work.

I learned a little bit more today that may be helpful.

Running the importing epochs and adding EEG positions within the GUI definitely works.

In past days, I told you that running eeg positions with "duke" didn't create any errors. I learned today that while it didn't cause the dot indexing error, this was because it did not seem to process the "...duke" file at all. And to confirm, when I try to use the "duke" file in the GUI, I get the error that the montage is not compatible with the positions template.

I've also noticed that while I continue to get the dot indexing error as described before, it actually correctly imports the channel positions. So if I click on "EEG channels" in the GUI after getting the error in the script, the montage looks correct.

Because of this observation, I re-ran the positions script after getting the error. This second time, it does not cause a matlab error, but says, "BST> bst_process: File indices changed, reloading files list..."

Here is before and after running the positions script (that produces the error)

I know this is confusing, so the files are available in the prior post, and now the script (produced via process templates) is available at this link: script_new.m - Google Drive

Hopefully this moves us a bit closer to solving this? Thanks Raymundo!

I'm having an hard time to replicate your issue. The provided data and scripts seems to be fine over here. Can you provide more details? Such as:

  • OS (if macOS, also specify CPU arch, Intel or AppleSilicon)
  • Matlab version
  • Brainstorm database path: bst_get('BrainstormDbDir')
  • Protocol information: bst_get('ProtocolInfo')

The GUI actions and the script call the same functions. As you mentioned, running the script leads to an error, however, even with the error it works. So everything points to a mishandling of the process output (needed in the script to create pipelines).

Can you modify the process file process_channel_addloc.m, add the line:


just before the last end of the file. Note that it does not end with ;
Run the process from your script and share the paths print in the Matlab command window

If some paths contain sensitive information, you could send them as DM

Raymundo, thank you so much for your patience. I am sorry about this.

OS: will get this to you asap, it is the institution's virtual environment and i can't find the clear answer

matlab: 2023a



output from the script:

i remain convinced I'm making some foolish mistake, I just can't figure out what!

to follow-up on OS: The Virtual Desktop runs XFCE on Linux (Red Hat EL 7.7).

... everything seem ok. I've tested in at least three computers and it does work.

Have you been able to run this script without troubles in other computer?

To debug it:

  1. Place a Breakpoint in bst_process at line 285
    allStudies = bst_get('Study', unique([sInputs.iStudy]));

  2. Open sInputs variable to see its content, and post it