Error while adding tag to time frequency source files

I have time-frequency source files which I need to tag. The source files are in the Group_analysis folder (after project_to_cortex and spatial smoothing). Both, while scripting and using the GUI I am getting an error showing Dot indexing is not available for variable of this type. Also, the sFiles given into the bst_report / process1 are getting corrupted and show-

Line 360: Whos
Could not find {file path}.....

Hi @rajat
It's hard to understand the error from your description.

What tag do you want to add to the files?
Can you share a full screenshot of the error and, if possible, a view of the brainstorm showing how the data is organized?

Hi @tmedani
Thank you for your quick reply.

The script I am using is as follows:

   main_folder = '/media/rajat/Rasendisk/lab/brainstorm_db/SOA/data/';
   conditions ={'base_no_feedback', '50_no_feedback','50_feedback','75_no_feedback','75_feedback',};

for ii = 1:length(conditions)
    filePattern = fullfile(main_folder, '*Group_analysis*' , 'Response-locked', '*smooth*');
    files = struct2table(dir(filePattern));
    sFiles = strcat(files.folder, '/', files.name);
    sFiles = sFiles(contains(sFiles, conditions{ii}));
    
    % Start a new report
    bst_report('Start', sFiles);
    
    % Process: Average: Everything
    sFiles = bst_process('CallProcess', 'process_average', sFiles, [], ...
        'avgtype',         1, ...  % Everything
        'avg_func',        1, ...  % Arithmetic average:  mean(x)
        'weighted',        0, ...
        'scalenormalized', 0);
   
    % Process: Add tag: baseline
    sFiles = bst_process('CallProcess', 'process_add_tag', sFiles, [], ...
        'tag',           char(conditions(ii)), ...
        'output',        1);  % Add to file name

    sFiles = bst_process('CallProcess', 'process_add_tag', sFiles, [], ...
        'tag',          char(conditions(ii)), ...
        'output',        2);  % Add to file path
          
    % 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');
end

The error--

Dot indexing is not supported for variables of this type.

Error in bst_process>Run (line 285)
        allStudies = bst_get('Study', unique([sInputs.iStudy]));

Error in bst_process>CallProcess (line 2314)
        OutputFiles = Run(sProcess, sInputs, sInputs2, 0);

Error in bst_process (line 38)
eval(macro_method);

The following is a picture to help with the structure of the data:

The following is a ss of the error that I get when I try open the output file:

Thank you, @rajat, for sharing the details.
@Raymundo.Cassani will have a better answer for you, he will be back this Monday.

This error is related to the fact that one of your processes received an empty input (sFiles = [])
Did you have further information on the Report? Menu File > Report viewer


The error with whos on opening the file is due to the fact that the indicated file does not exist.
Have you check this?

It is likely that the code to add tags failed, then the tag was added to the file path but not updated in the database.

Right-click on the higher node in the Protocol and select Reload
This action will regenerate the database tree based on the HDD content

Hi @Raymundo.Cassani !
Thank you for your reply.

The following is the report file generated after the averaging-

Reloading the folder from the database did not help solve the problem and once again gave the dot indexing error. Reloading the entire database gave the following error-

The file seems to be present in the database with the added tag, which is not updated in the viewer. Opening the new file from the BRAINSTORM viewer gives the 'whos' error. If I skip the tagging step, I am able to open the newly generated averaged file. However, tagging the file seems to cause the error.

Could you share the averaged file to test the tagging?

Thank you @Raymundo.Cassani !
The Tagging error seems to have been fixed for now. I believe there was an issue with the structure of the database. Fixing that fixed the dot indexing error.
Once again Thank you for your time and help.

1 Like