Skip to content

Conversation

rcassani
Copy link
Member

@rcassani rcassani commented Sep 4, 2025

This PR aims to incorporate the processes and provided by Brian A Coffman, PhD into Brainstorm.

These codes come from the discussion in the Brainstorm forum:
https://neuroimage.usc.edu/forums/t/52675

Original post in Forum:

Hello Brainstorm community, I have created a simple process for linear regression of single-trial data. It works with sensors, sources, timefreq, and matrix datatypes, and can be used in batch to process many subjects. The process uses the process2 tab - the user enters data for all trials in FilesA, and matrix files containing the trial-by-trial regressors in FilesB, with one matrix file for each study entered in FilesA. The matrix file should contain one trial per row, and one column per regressor + a trial rejection column at the end. The first column should be all ones for the intercept, if it is to be included in the model and the last column should be all zeros, unless you want to reject trials based on, for example, trial type or behavior. I would be happy to share this code if it is of interest to others.

Example dataset

Sure, I would be happy to contribute.

CNRLregression_tutorial.zip

The above link sources a Neuromag MEG data obtained during variable intensity AEF/AEP task (passive) from a single subject from our recently published work in this area. Continuous data are provided as well as low pass filtered data (55Hz) and segmented/baseline corrected trials (Tone; 50 ms duration, 10ms rise/fall). The regressor matrix used the attached plugin to pull regressor values from trial data (notice that all ‘Tone’ trials also have another event characterizing their intensity (75, 80, or 85 dB). The function takes trial data as input alongside descriptions/titles of regressors (comma-separated, one for each event contained in all trials - all trials must have same number of events, and this number must match the number of values entered here) and there is a checkbox for including the intercept.

These trials can be used in FilesA, and this matrix in FilesB of the process2 menu for use in the CNRL regression plugin. Let me know if you have any further questions!

Files provided by Brian A Coffman, PhD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant