Error in [process_channel_addloc]

Hello Brainstorm community,

I came across the following error message while using Add EEG positions process.

In the error message and in the corresponding Github link provided, there were some ways to resolve such an issue. The error message (and the Github solution) says that I must edit my processing script: "use the pipeline editor to generate a new script to call process_channel_add".

I thought at first that I needed to change the codes within the toolbox/process/functions/process_channel_addloc.m as specified in Github solutions but the codes were already updated. Then I thought there must be a new process called Channel Add in the pipeline editor but I could not find this. Then I tried updating the Brainstorm software multiple times which did not work.
I did many more things other than these and I am now stuck.

I am confused about what I am supposed to do.
What exactly am I supposed to do?

This error should be visible only when calling the process from a script.

The old syntax was:

% Process: Add EEG positions
sFiles = bst_process('CallProcess', 'process_channel_addloc', sFiles, [], ...
    'channelfile', {'', ''}, ...
    'usedefault',  47, ...  % ICBM152: 10-10 65
    'fixunits',    1, ...
    'vox2ras',     1);

The new syntax uses a string instead of an integer:

% Process: Add EEG positions
sFiles = bst_process('CallProcess', 'process_channel_addloc', sFiles, [], ...
    'channelfile', {'', ''}, ...
    'usedefault',  'ICBM152: 10-10 65', ...  % ICBM152: 10-10 65
    'fixunits',    1, ...
    'vox2ras',     1);

As the error message did not seem clear to you, I guess this is not the way you started this process.
Can you please describe how you start this process?
And with what options?

I adjusted a few things in the code: Bugfix: Follow-up to modifications of process_channel_addloc (142ae20) · brainstorm-tools/brainstorm3@013fb9f · GitHub
So start by updating Brainstorm again.

If you still get the same message, reset the options from the Pipeline Editor window (in the drop-down menu).

Please let me know how you solve this issue, as I might need to adjust something so that not all users face the same problem. Thanks

Thank you for your reply Francois.

The following pipeline editor was how I used the "Add EEG positions" process.
It comes after the "set channels type" process specifying EOG channels and before the "band-pass" process of 1 - 40 Hz.
Brainstorm

I then followed the "reset options" button and independently selected the "add EEG positions" process which looked like below.
Brainstorm1

Clearly the process options were different. So I put one of my files through this process and it worked without issues. Then I incorporated this NEW process within the above pipeline after deleting the old "add EEG positions" process. Running this new pipeline editor with the new process worked well. So I think it must have been just a matter of updating this specific process.

I did try this method yesterday however back then the process options did not look like what I am showing you today - so your code update must have solved the issues.

After incorporating the NEW process into the following pipeline editor below I now have a new "input options" - circled in red. What does this mean?? I could not find this in the Brainstorm Tutorial.

Indeed, this is what the error message was asking you to do: edit your processing pipeline.
But indeed, if you are only using the pipeline editor, the word "script" is not clear.
I edited a bit the error message: do you think it will help understand other users?
If you can think of a better way to explain in one sentence what to do, please share your suggestions.

After incorporating the NEW process into the following pipeline editor below I now have a new "input options" - circled in red. What does this mean?

This option "Use absolute values of source activations" appears inappropriately because there are errors in the inputs to this pipeline (the files selected in the Process1 tab). This is indicated by this red "Error" message at the top of the pipeline editor.

In general, I would recommend you use the pipeline editor to create Matlab script, and then execute these scripts, instead executing saved pipelines from the Brainstorm interface. This has multiple advantages:

  • It makes it easy to share your script, for debugging purposes for example (as in this present discussion)
  • It is easier to review all the parameters of the script
  • It will be easier to adapt your script to future versions of Brainstorm
  • You can keep your scripts together with your data for bookkeeping, and future reproducibility.

Depending on when you created the original pipeline, it might be a good idea to check if there were updates to other processes. In general, we make efforts to make previous scripts working, but not necessarily using the newer methods available. If you need a strict reproducibility with a previous pipeline (i.e. adding new subjects to an old study), keep you scripts unmodified. If you start a new study: create again the script instead of reusing an old one.

Does it have to be one sentence? How about the following?
"If you get this error, you must edit your processing script.
If you are only using the pipeline editor please replace the old process with the new one."

However, if it has to be a single sentence I think what you have there currently is fine. OR
"If you get this error, you must edit your processing script (or saved pipeline; replace with a new process)"

And thanks for all your other suggestions - much appreciated.