[1/3] Fastgraph: Customize SPES blocks (Nihon Kohden)#913
Closed
chinmaychinara91 wants to merge 1 commit intobrainstorm-tools:masterfrom
Closed
[1/3] Fastgraph: Customize SPES blocks (Nihon Kohden)#913chinmaychinara91 wants to merge 1 commit intobrainstorm-tools:masterfrom
chinmaychinara91 wants to merge 1 commit intobrainstorm-tools:masterfrom
Conversation
This was referenced Apr 28, 2026
Member
Author
|
Closing this based on our discussion. Will continue on PR #911. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Inputs
Update 'Stim Start' labelandUpdate 'Stim Stop' label: Gives an option to the user to rename theStim StartandStim Stoplabels in the imported NK events if they want to. In this case, we are shortening the labels toSBandSErespectively. 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 (hereDC10) in the imported NK events if they want to (here, change toSTIM). 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
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].
Detect all the stimulation triggers (here,

DC10). Drag theBaseline > Link to raw fileto theProcess1tab and clock onRun > Events > Detect analog triggers. Use values in the GUI as under and clickRun.We then get the

DC10trigger events added to the raw data as under.Drag the

Baseline > Link to raw fileto theProcess1tab and click onRun > Import > Import recordings > Import MEG/EEG: Events. Use values in the GUI as under and clickRun. For this sample data, we will be importing allStim Startevents 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).Then we get all the desired stimulation blocks imported as under.

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

Process1tab and click onRun > Stimulation > Customize SPES blocks (Nihon Kohden). Use values as inthe GUIsection above and clickRun. Each of the stimulation blocks get updated as under.NOTE:
STIM,ODDandEVENevent labels are appended with the stim site information (e.g.A11-A12 4 #1in the figure above whereA11-A12 4means stimulation was delivered between contacts A11 and A12 at 4 milliamps and the#1means the first session. You can see in the image there is also a 2nd session which is the blockSB 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
@jcmosher @Nastaranlotfi @yashvakilna