Custom processing for ABR weighted averaging

I suggest you create two files, instead of modifying the structures.
If you modify the number of "data channels", you need to modify the channel file, and the field ChannelFlag in the data structure. This is much more complicated and I'm not sure it

How do I change this code so that it reflects what I want the file to be called?
It's getting a bit confusing when all my custom files are being called 'data_custom_'

You can edit the file name, but keep the tag 'data_' at the beginning of the file. This is what identifies the type of the file in the database.
If you want to change the label displayed in the database explorer, change the field Comment.

Reading the Scripting tutorial could help you:
https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting

1 Like

Spectacular :slight_smile: This is working perfectly.
Thank you so much for all your help Francois and Raymundo!
Thank you for being so patient with me and answering all my questions - you guys are a star :stars::stars::stars:
Hopefully, you will hear no more questions from me :wink:

Kind Regards,
MinChul Park

Hello Francois and Raymundo!
I attach the finished copies of my codes.
These are for ABR weighted averaging, and calculating classic and weighted residual noises.
Hope these become useful to fellow researchers around the globe.

Once again thank you so much for your patience and expertise.

Kind Regards,
MinChul Park

process_residual_noise.m (6.9 KB)
process_weighted_averaging.m (4.2 KB)

2 Likes

Thank you for these contributions! :tada:

We certainly can add them in the repository for Brainstorm users:

To provide users with details on these methods.
Could you provide us with relevant references about the methods, and/or where they have been used?

Best,
Raymundo

1 Like

I attach an article which describes the methods used.
The only slight difference lies in the weighted averaging calculation.
The article uses "blocks of sweeps" for weighting but I modified that slightly so that the weighted averaging does this by individual sweeps not "blocks of sweeps". But all other methods and rationale are the same.

This weighted approach is used in auditory brainstem response (ABR) acquisition and data analysis to minimise the effect of noise on the ABR recording, determine the level of that noise and also set criteria for when to stop recording (i.e. when residual noise falls below X stop the ABR acquisition).

If the number of sweeps used to acquire ABR was small, say less than 1000, this could be done easily and as fast using Excel. But usually, ABR needs a lot of sweeps (in my case 6000) and Excel was becoming quite clunky to handle data size this massive. Therefore Brainstorm is a much better way to process this kind of data.

Hope this is useful. :slight_smile:
Once again thank you to both of you for helping me and let me know once you've added my processes to GitHub so that I can share to others also.

Don and Elberling 1994 Evaluating residual background noise in ABRs.pdf (777.2 KB)

1 Like