Coding for adding tags in a custom process

Hello there,
I have a custom process to do weighted averaging based on residual noise of individual epochs (uploaded below). It's been modified to be able to group files just like the process_average.m.

process_weighted_averaging.m (5.0 KB)

In the below photo the "Avg: 1..." is the file generated by process_average.m and the four files below are from my custom process. I need to amend the current code so that the resulting files reflect previous processes that the file went through, things like "detrend", "bl" and "1". The number of files used to generate the file is already implemented. Therefore I would like the current code to be amended so that rather than showing "WAvg (10)", it shows "WAvg_RN: 1 | detrend | bl (10)" (where WAvg_RN is weighted average based on residual noise; this is because Brainstorm already has a weighted averaging option in the process_average.m which is based on effective number of averages which is different to my custom process). How can I amend this code to reflect this change?

image

The name displayed on the database explorer (aka tree) is the field Comment in the those files.
As such, you would need to update that field accordingly for each of the files that your custom process generates. As example you can check how the comment in process_average.m is done:

https://github.com/brainstorm-tools/brainstorm3/blob/7630f2b48e9ae587b5bb77b92196d6a5b1b6364f/toolbox/process/functions/process_average.m#L389

Thank you for providing that example Raymundo - things are working nicely :slight_smile: