Skip to content

[2/3] Fastgraph: Remove SPES artifacts using EMD#912

Draft
chinmaychinara91 wants to merge 5 commits intobrainstorm-tools:masterfrom
chinmaychinara91:fastgraph2
Draft

[2/3] Fastgraph: Remove SPES artifacts using EMD#912
chinmaychinara91 wants to merge 5 commits intobrainstorm-tools:masterfrom
chinmaychinara91:fastgraph2

Conversation

@chinmaychinara91
Copy link
Copy Markdown
Member

@chinmaychinara91 chinmaychinara91 commented Apr 21, 2026

This PR is the 2nd part required for Fastgraph. It involves cleaning the data for any artifacts.

Prerequisite: Follow steps in PR #913

Remove SPES artifacts

Linked to process_remove_spes_artifacts and it involves removing SPES artifacts and slow drifts using the Empirical Mode Decomposition (EMD) based filtering.

The GUI

image

Inputs

  • Stimulation event: The stimulation event around which to remove the artifacts (here, STIM)
  • EMD cutoff frequency (in Hz): Self explanatory
  • Time to account for artifact (in ms): The duration of the actual stimulation artifact itself, starting at the stimulation event. Used to set the main artifact span inside the interpolation window (here, 5 ms).
  • Time on either side of the artifact to spline with (in ms): How much clean signal to take from before and after that artifact window so the spline has anchor points to interpolate across the bad segment (here, 3 ms).

Steps to use

  1. Follow steps as in PR [1/3] Fastgraph: Customize SPES blocks (Nihon Kohden) #913 .
  2. Drag the loaded stimulation blocks into the Process1 tab. For e.g. SB A13-A14 4 (#1) .
  3. Click on Run > Stimulation > Remove SPES artifacts.
  4. Fill in the values as seen in the GUI figure above. Click Run.

It creates new stimulation block e.g. SB A13-A14 4 (#1)_emd. The results can be seen as under.
Screenshot 2026-04-21 140035

Associated PRs

  1. [1/3] Fastgraph: Customize SPES blocks (Nihon Kohden) #913
  2. Plot Fastgraphs (3rd PR) - TO BE ADDED

@jcmosher @Nastaranlotfi @yashvakilna

Remove Single-Pulse Electrical Stimulation (SPES) artifacts and slow drifts using Empirical Mode Decomposition (EMD) based filtering.
@chinmaychinara91 chinmaychinara91 marked this pull request as ready for review April 29, 2026 14:10
@chinmaychinara91 chinmaychinara91 marked this pull request as draft April 29, 2026 17:20
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