Skip to content

Conversation

@NGharesi
Copy link
Contributor

@NGharesi NGharesi commented Dec 5, 2025

No description provided.

NGharesi and others added 5 commits December 4, 2025 16:01
- Simpler load of timeseries
- Add information (name and units) for APC features
- Add History
- Register output files in database
Copy link
Member

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
Copy link
Member

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)';
Copy link
Member

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';
Copy link
Member

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?

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;
Copy link
Member

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

Comment on lines +132 to +134
apcFeatures = {pacStr, phaseFreq, ampFreq, prefPhase};
apcLabels = {'pacStr','phaseFreq','ampFreq','prefPhase'};
apcUnits = {'??', 'Hz', 'Hz', '??'};
Copy link
Member

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...

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));
Copy link
Member

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

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.

2 participants