Error when computing Morlet wavelets on scouts

Hi, I tried computing time-frequency (Morlet wavelet) on scouts for EEG data, but I receive an error.

Specifically, I have unconstrained sources (sLORETA, BEM head model default anatomy ICBM152 2023b). I selected PCA (before) as scout function on a custom atlas (subset of ROIs from Desikan-Killiany atlas).

2023-06-27_174233

This is the code I'm running:

eeg_tf = bst_process('CallProcess', 'process_timefreq', eeg, [], ...
            'clusters',      {'Desikan-Killiany_custom', {'bankssts L', 'bankssts R', 'inferiorparietal L', 'inferiorparietal R', 'inferiortemporal L', 'inferiortemporal R', 'lateraloccipital L', 'lateraloccipital R', 'middletemporal L', 'middletemporal R', 'parsopercularis L', 'parsopercularis R', 'parsorbitalis L', 'parsorbitalis R', 'parstriangularis L', 'parstriangularis R', 'rostralmiddlefrontal L', 'rostralmiddlefrontal R', 'superiortemporal L', 'superiortemporal R', 'supramarginal L', 'supramarginal R', 'transversetemporal L', 'transversetemporal R'}}, ...
            'scoutfunc',     3, ...  % PCA
            'edit',          struct(...
                 'Comment',         'Scouts,Power,FreqBands', ...
                 'TimeBands',       [], ...
                 'Freqs',           {{'alpha', '8, 12', 'mean'; 'beta1', '13, 19', 'mean'; 'beta2', '20, 30', 'mean'}}, ...
                 'MorletFc',        1, ...
                 'MorletFwhmTc',    3, ...
                 'ClusterFuncTime', 'before', ...
                 'Measure',         'power', ...
                 'Output',          'all', ...
                 'RemoveEvoked',    0, ...
                 'SaveKernel',      0), ...
            'normalize2020', 0, ...
            'normalize',     'none');  % None: Save non-standardized time-frequency maps

I had already used this procedure in the past (both from GUI and from script), but now, after the flattening procedure, when it should start TF decomposition, I get errors saying that PCA for scouts requires saving files (error #1), so the function to compute Morlet wavelets cannot access scout time-series (error #2):

2023-06-27_173925

I have checked the tutorial on TF on scouts for any update, but I didn't find any. Has there been any changes to how to compute TF on scouts?

Thanks

Any suggestions? I'm stuck. Thanks.

Thanks for reporting, Simon.
We have changed the PCA procedure recently, which may cause unexpected trouble down the pipe, despite extensive checks.
Pinging @Marc.Lalancette here as he has driven these efforts in recent weeks.

Thank you, Sylvain. I tried a workaround, namely separately computing PCA and then TF on the matrices. It should yield the same result, right?

Hello Simone,
Sorry for the delay, I was away for a few days. Indeed PCA was changed but the time-frequency processes have not yet been updated. As you mentioned, I recommend using the process Extract Scouts first, then the time-frequency process. Please let us know if you run into other errors with that approach.
Best,
Marc