-
Notifications
You must be signed in to change notification settings - Fork 176
Add and edit APC Brainstorm processing scripts #862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Simpler load of timeseries - Add information (name and units) for APC features - Add History - Register output files in database
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is APC Amplitude-Phase Coupling?
Maybe worth to mention the difference with PAC
|
|
||
| %% ===== GET DESCRIPTION ===== | ||
| function sProcess = GetDescription() | ||
| sProcess.Comment = 'APC (Custom)'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change process to: Full name (APC)
| sProcess.Category = 'File'; | ||
| sProcess.SubGroup = 'Frequency'; | ||
| sProcess.Index = 656; | ||
| sProcess.Description = 'https://neuroimage.usc.edu/brainstorm/Tutorials/Connectivity'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there are dedicated tutorial page?
| 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid impossible combinations, validation of the user inputs is needed
| apcFeatures = {pacStr, phaseFreq, ampFreq, prefPhase}; | ||
| apcLabels = {'pacStr','phaseFreq','ampFreq','prefPhase'}; | ||
| apcUnits = {'??', 'Hz', 'Hz', '??'}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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...
| % Add history | ||
| sMatOut = bst_history('add', sMatOut, 'process', ... | ||
| sprintf('process_apc: APC %s, file: %s', apcLabels{iFeature}, sInput.FileName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want add more information to the history field.
E.g. the value of the parameters
No description provided.