[2/3] Fastgraph: Remove SPES artifacts using EMD - #912
Conversation
Remove Single-Pulse Electrical Stimulation (SPES) artifacts and slow drifts using Empirical Mode Decomposition (EMD) based filtering.
rcassani
left a comment
There was a problem hiding this comment.
This PR presents the process process_remove_spes_artifacts to remove artifacts from stimulation, and to remove drift.
There is reason for artifact-removal operations to be in the same process. It would be more versatile to have them in two different process, so Brainstorm users can use them separately.
|
|
||
| % Convert trigger times to sample indices | ||
| stimTimes = DataMat.Events(iStimEvent).times; | ||
| [isMatch, stimSamples] = ismembertol(stimTimes, DataMat.Time, 1e-7); |
The reason we do stimulation artifact removal before drift correction is to avoid the large transient artifacts that may bias the drift estimate. Hence, we decided to club them in one process here.
I agree that the two operations are conceptually independent, and separating them into two independent processes would definitely make the workflow more flexible for users. Thank you for the recommendation. @jcmosher, any more inputs on this ? Should I go ahead and create two separate processes? While documenting in the tutorial, we can suggest the recommended order for the users when both steps are applied. |
Drift removal with EMD can be applied to any other data, that is the reason to have it separated. In the tutorial explain what each process do and that will lead the reasoning about the order in which the processes must be used for that tutorial, not a suggestion. As swapping the order is incorrect way to do it for the data of that tutorial. |
- Rename processes as per the changes in PR brainstorm-tools#911 and brainstorm-tools#912 - Adding `ODD` and `EVEN` events not part of the tutorial (left at user's discretion with a note added to the tutorial about it). As recommended by @jcmosher.
This PR is the 2nd part required for Fastgraph. It involves cleaning the data for any artifacts.
Prerequisite: Follow steps in PR #911
Remove SPES artifacts
Linked to
process_remove_spes_artifactsand it involves removing SPES artifacts and slow drifts using the Empirical Mode Decomposition (EMD) based filtering.The GUI
Inputs
STIM)5ms).3ms).Steps to use
Process1tab. For e.g.SB A13-A14 4 (#1).Run > Stimulation > Remove SPES artifacts.Run.It creates new stimulation block e.g.

SB A13-A14 4 (#1)_emd. The results can be seen as under.Associated PRs
@jcmosher @Nastaranlotfi @yashvakilna