Problem in extracting values from the scouts

I am running analysis for MEG-data. I started the analysis a year ago and have only now returned to it. It seems that the Matlab-scripts that I have are no longer producing the same results as they did a year ago. I have problems with extracting values from scouts. I am using exactly the same scripts and data as in Spring 2023, but I no longer can get the same source information out. I only now tried to do "extract values" and I am using it for the same processed data as last year so the input files are exactly the same as previous.

For example, I want to extract values from 6 scouts (left and right for Fusiform, medial Orbitofrontal and lateral Orbitofrontal using Desikan-Killiany Atlas). I have done the source localization with minimum norm estimation using unconstrained orientation. For analysis I want to use the norm from the three orientations. I have below the screen shot of the Matlab script for extracting source values. I also tried it with the pipeline editor using the following steps:
( I tried to include screenshots but can't seem to get them to this text-editor)

I chose the following steps for pipeline-editor:

  • Selecting the unconstrained source files that I have for 3 different stimulus conditions. Selected -- process sources -- run -extract -extract values:
  • time-window: 400 ms - 600 ms
  • Use scouts: (from Desikan-Killiany Atlas), clicked active the 6 scouts
  • scout function: mean
  • compute absolute values
  • average time window
  • concatenate time

Here is the same in script: (trying to get mean value for time window 400-600 ms for the 6 scouts)

% Script generated by Brainstorm (19-Apr-2024)

% Input files
sFiles = {...
    'Subject21_2/average/results_dSPM-unscaled_MEG_GRAD_MEG_MAG_KERNEL_230303_1257.mat', ...
    'Subject21_2/average/results_dSPM-unscaled_MEG_GRAD_MEG_MAG_KERNEL_230303_1300.mat', ...

% Start a new report
bst_report('Start', sFiles);

% Process: Extract values: [400ms,600ms] 6 scouts abs
sFiles = bst_process('CallProcess', 'process_extract_values', sFiles, [], ...
    'timewindow', [0.4, 0.6], ...
    'scoutsel',   {'From volume: Desikan-Killiany', {'Fusiform L', 'Fusiform R', 'Lateral orbitofrontal L', 'Lateral orbitofrontal R', 'Medial orbitofrontal L', 'Medial orbitofrontal R'}}, ...
    'scoutfunc',  1, ...  % Mean
    'isnorm',     1, ...
    'avgtime',    1, ...
    'dim',        2, ...  % Concatenate time (dimension 2)
    'Comment',    '');

% Save and display report
ReportFile = bst_report('Save', sFiles);
bst_report('Open', ReportFile);
% bst_report('Export', ReportFile, ExportDir);
% bst_report('Email', ReportFile, username, to, subject, isFullReport);

% Delete temporary files
% gui_brainstorm('EmptyTempFolder');

Previously with these selections (if I look at the results of extraction that was done last year): I did get one value for each 6 scouts and for each 3 stimuli. Show a 6 x 3 table. Now I get 18 x 3 table.
It seems that the selections don’t work similarly as previously. I only get values for the first selected scouts (Fusiform left and right) while all the other scouts are empty. Instead of one value for each scout I get 9 values for the first scout. They are labeled as: Fusiform_L1.1; Fusiform_L1.2, Fusiform L1.3, Fusiform 2.1, Fusiform L2.2, FusiformL2.3, Fusiform L3.1, Fusiform L3.2, Fusiform L3.3. After this it is the same for Fusiform_R. There is also column labeled time which has three rows: 1, 2, 3.
Could it be that it is extracting all the 3 orientations for each scout and somehow also presenting the results for the 3 stimuli multiple times?

How can I extract values for the selected scouts and time windows? How to set the selections so that I get norm of the orientations for each scout and also an average over a selected time window?
I have updated the Brainstorm, so it should be the latest version.

Thank you for your help!

Hi Elisa,

Thank you for the detailed report on this discrepancy.

It was an issue with the process Extract values, it is now fixed at e4317b5.
Please update your Brainstorm instance to get the fix.

Please note that with the process Extract values using Scouts, Unconstrained sources, Norm and averaging in a time window the operation order is:

  1. For one Scout the sources have a shape [nVertices, nSamples, 3]
  2. Scout function is applied in each XYZ orientation, resulting in a shape [nSamples, 3]
  3. Norm is applied across orientations XYZ, resulting in shape [nSamples, 1]
  4. Finally average in the time window is computed, resulting in one value per scout.

Thank you!
It seems to work now with the new update.