Apply montage to PSD

Hello Brainstorm users. Has anyone written a script to apply a montage to PSD transformations. I'm interested in computing hemispheric asymmetry (e.g., Left - Right) after measuring power spectrum with PSD. Before potentially re-inventing the wheel, I thought I would ask here.
Thanks!
paul

The functions in Brainstorm allow applying montages only on recordings.
However, you can probably re-use some lower-lever functions on PSD files.
Something like the following (inspired from process_montage_apply.m, not tested):

% Load input file 
PsdMat = in_bst_timefreq(PsdFile);
% Get the montage
sMontage = panel_montage('GetMontage', MontageName);
% Get channels indices for the montage
[iChannels, iMatrixChan, iMatrixDisp] = panel_montage('GetMontageChannels', sMontage, PsdMat.RowNames);
% Apply montage
for iFreq = 1:size(PsdMat.TF,3)
    PsdMat.TF(iChannels,:) = panel_montage('ApplyMontage', sMontage, PsdMat.TF(iChannels,:,iFreq), PsdFile, iMatrixDisp, iMatrixChan);
end


Help for righting scripts and processes: