Skip to content

[1/3] Fastgraph: Customize SPES blocks (Nihon Kohden)#913

Closed
chinmaychinara91 wants to merge 1 commit intobrainstorm-tools:masterfrom
chinmaychinara91:fastgraph1_new
Closed

[1/3] Fastgraph: Customize SPES blocks (Nihon Kohden)#913
chinmaychinara91 wants to merge 1 commit intobrainstorm-tools:masterfrom
chinmaychinara91:fastgraph1_new

Conversation

@chinmaychinara91
Copy link
Copy Markdown
Member

Based on our discussion in PR #911.

This PR is the first part required for Fastgraph. It involves customizing the imported SPES blocks.

Customize SPES blocks (Nihon Kohden)

Linked to process_customize_spes_nk.

The GUI

image

Inputs

  • Update 'Stim Start' label and Update 'Stim Stop' label: Gives an option to the user to rename the Stim Start and Stim Stop labels in the imported NK events if they want to. In this case, we are shortening the labels to SB and SE respectively. Came as a requirement from UTH as the channel names can get very long, thereby making the overall stimulation event label very long.
  • Stimulation trigger event label: The stimulation trigger channel in the recordings (here, DC10)
  • Update stimulation trigger event label: Gives an option to the user to rename the stimulation trigger event label (here DC10) in the imported NK events if they want to (here, change to STIM). Came from UTH, but maybe some other centers might have their own way of naming, so good to have this option.
  • Add ''ODD'' and ''EVEN'' events: If we check this, then it creates alternating monophasic stimulations from the original stimulation event. This is useful in downstream analysis as the odd and even pulses may produce different responses. We will be using this approach for plotting Fastgraph (3rd PR).

Steps to use

  1. Load in the updated example test protocol [ NOTE: This preprocessed protocol involves running CAT12 segmentation to get all the anatomical information, the implantation done using Brainstorm, and then loading in the raw data and adding the locations from the implantation to it. These steps will be part of the main tutorial and the tutorial script].

  2. Detect all the stimulation triggers (here, DC10). Drag the Baseline > Link to raw file to the Process1 tab and clock on Run > Events > Detect analog triggers. Use values in the GUI as under and click Run.
    image

  3. We then get the DC10 trigger events added to the raw data as under.
    Screenshot 2026-04-27 192319

  4. Drag the Baseline > Link to raw file to the Process1 tab and click on Run > Import > Import recordings > Import MEG/EEG: Events. Use values in the GUI as under and click Run. For this sample data, we will be importing all Stim Start events with epoch of 40s (30s block with a buffer of 5s around the stimulation block so that it contains the full stimulation segment plus some context before and after it).
    image

  5. Then we get all the desired stimulation blocks imported as under.
    image

  6. Next step is to customize the stimulation block names and event labels based on how the user wants it. Drag all the stimulation blocks to Process1 tab and click on Run > Stimulation > Customize SPES blocks (Nihon Kohden). Use values as in the GUI section above and click Run. Each of the stimulation blocks get updated as under.
    image

NOTE: STIM, ODD and EVEN event labels are appended with the stim site information (e.g. A11-A12 4 #1 in the figure above where A11-A12 4 means stimulation was delivered between contacts A11 and A12 at 4 milliamps and the #1 means the first session. You can see in the image there is also a 2nd session which is the block SB A11-A12 4 (#2). Analyzing each of these sessions separately is required during the downstream analysis which will be clearer in the 3rd PR.

Associated PRs

  1. [2/3] Fastgraph: Remove SPES artifacts using EMD #912
  2. Plot Fastgraphs (3rd PR) - TO BE ADDED

@jcmosher @Nastaranlotfi @yashvakilna

@chinmaychinara91 chinmaychinara91 marked this pull request as ready for review April 28, 2026 03:06
@chinmaychinara91 chinmaychinara91 marked this pull request as draft April 29, 2026 17:59
@chinmaychinara91
Copy link
Copy Markdown
Member Author

Closing this based on our discussion. Will continue on PR #911.

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