Add and edit APC Brainstorm processing scripts#862
Open
NGharesi wants to merge 5 commits intobrainstorm-tools:masterfrom
Open
Add and edit APC Brainstorm processing scripts#862NGharesi wants to merge 5 commits intobrainstorm-tools:masterfrom
NGharesi wants to merge 5 commits intobrainstorm-tools:masterfrom
Conversation
- Simpler load of timeseries - Add information (name and units) for APC features - Add History - Register output files in database
rcassani
requested changes
Dec 5, 2025
Member
There was a problem hiding this comment.
This files needs:
- A brief description of what it does
- Description of the inputs args, including all the expected fields in
OPTIONS - Description of the outputs
- A reference if available
| @@ -0,0 +1,172 @@ | |||
| function varargout = process_apc(varargin) | |||
| % PROCESS_APC: Compute the Amplitude-Phase coupling for time series | |||
Member
There was a problem hiding this comment.
Is APC Amplitude-Phase Coupling?
Maybe worth to mention the difference with PAC
|
|
||
| %% ===== GET DESCRIPTION ===== | ||
| function sProcess = GetDescription() | ||
| sProcess.Comment = 'APC (Custom)'; |
Member
There was a problem hiding this comment.
Change process to: Full name (APC)
| sProcess.Category = 'File'; | ||
| sProcess.SubGroup = 'Frequency'; | ||
| sProcess.Index = 656; | ||
| sProcess.Description = 'https://neuroimage.usc.edu/brainstorm/Tutorials/Connectivity'; |
Member
There was a problem hiding this comment.
Is there are dedicated tutorial page?
Comment on lines
+107
to
+121
| OPTIONS.fA = sProcess.options.fA.Value{1}; | ||
| OPTIONS.epoch = sProcess.options.epoch.Value{1}; | ||
| OPTIONS.decomposition= sProcess.options.decomposition.Value; | ||
| OPTIONS.diagm = sProcess.options.diagm.Value; | ||
| OPTIONS.srate = sProcess.options.srate.Value{1}; | ||
| OPTIONS.idataType = sProcess.options.idataType.Value; | ||
| OPTIONS.dataLength = sProcess.options.dataLength.Value{1}; | ||
| OPTIONS.surrogates = sProcess.options.surrogates.Value; | ||
| OPTIONS.num_perm = sProcess.options.num_perm.Value{1}; | ||
| OPTIONS.numPhaseBins = sProcess.options.varargin.Value{1}; | ||
|
|
||
| % Load timeseries | ||
| [sMatIn, matName] = in_bst(sInput.FileName); | ||
| sMatApc.data = sMatIn.(matName); | ||
| sMatApc.time = sMatIn.Time; |
Member
There was a problem hiding this comment.
To avoid impossible combinations, validation of the user inputs is needed
Comment on lines
+132
to
+134
| apcFeatures = {pacStr, phaseFreq, ampFreq, prefPhase}; | ||
| apcLabels = {'pacStr','phaseFreq','ampFreq','prefPhase'}; | ||
| apcUnits = {'??', 'Hz', 'Hz', '??'}; |
Member
There was a problem hiding this comment.
It would be better if bst_pac returns the label and unit for each feature. E.g.
sApc = bst_apc()
sApc.pacStr.Value = Values;
sApc.pacStr.Units = '??';
% etc...
Comment on lines
+160
to
+162
| % Add history | ||
| sMatOut = bst_history('add', sMatOut, 'process', ... | ||
| sprintf('process_apc: APC %s, file: %s', apcLabels{iFeature}, sInput.FileName)); |
Member
There was a problem hiding this comment.
You may want add more information to the history field.
E.g. the value of the parameters
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.
No description provided.