Hi
I have a database with EEG data and I have created electrode clusters. When I have used clusters I always could open clusters for any subject in the following ways:
I could open clusters with no further file opened - i.e. selecting the files to overlap for visualisation together with previously opened clusters in the panel.
If I wanted to export cluster time series, I just opened the clusters and applied to all subject being exported at once. Only opening the clusters in the panel I could visualise the clusters in the RUN/extract cluster time series.
I believe that from the last BS update I applied recently, I need to save the clusters one by one to each subject/condition to be able to export clusters for a group of subjects. This might be tedious because Each subject has many conditions with associated channel files and as I see I might need to save the clusters for each channel file.
Is there any way to apply the clusters to all subjects/conditions - channel files at the same time?
Thank you very much.
Elena
Hi Elena,
I added a new function db_set_clusters.m
to help you deal with clusters programmatically:
function OutputFiles = db_set_clusters(ChannelFile, Target, Clusters)
% DB_SET_CLUSTERS: Set the list of clusters saved in the channel files of target folders
%
% USAGE: OutputFiles = db_set_clusters(ChannelFile, iDestStudies) : Copy clusters from a channel file to the target folders
% OutputFiles = db_set_clusters(ChannelFile, 'AllConditions'): Copy clusters from a channel file to all the folders in the same subject
% OutputFiles = db_set_clusters(ChannelFile, 'AllSubjects') : Copy clusters from a channel file to all the folders in all the subjects
% OutputFiles = db_set_clusters(..., Clusters) : Copy input clusters to the target studies (instead of reading then from input channel file)
% OutputFiles = db_set_clusters(..., []) : Empty the list of clusters in the target studies
% @=============================================================================
% This function is part of the Brainstorm software:
% https://neuroimage.usc.edu/brainstorm
%
% Copyright (c) University of Southern California & McGill University
I added some examples in the tutorials:
function OutputFiles = db_set_clusters(ChannelFile, Target, Clusters)
% DB_SET_CLUSTERS: Set the list of clusters saved in the channel files of target folders
%
% USAGE: OutputFiles = db_set_clusters(ChannelFile, iDestStudies) : Copy clusters from a channel file to the target folders
% OutputFiles = db_set_clusters(ChannelFile, 'AllConditions'): Copy clusters from a channel file to all the folders in the same subject
% OutputFiles = db_set_clusters(ChannelFile, 'AllSubjects') : Copy clusters from a channel file to all the folders in all the subjects
% OutputFiles = db_set_clusters(..., Clusters) : Copy input clusters to the target studies (instead of reading then from input channel file)
% OutputFiles = db_set_clusters(..., []) : Empty the list of clusters in the target studies
% @=============================================================================
% This function is part of the Brainstorm software:
% https://neuroimage.usc.edu/brainstorm
%
% Copyright (c) University of Southern California & McGill University
% This software is distributed under the terms of the GNU General Public License
% as published by the Free Software Foundation. Further details on the GPLv3
% license can be found at http://www.gnu.org/copyleft/gpl.html.
%
% FOR RESEARCH PURPOSES ONLY. THE SOFTWARE IS PROVIDED "AS IS," AND THE
% UNIVERSITY OF SOUTHERN CALIFORNIA AND ITS COLLABORATORS DO NOT MAKE ANY
This file has been truncated. show original
Let me know if you think of other options for these functions that would make your life easier.
Dear Francois,
It worked great. I run it from the command window, specifying the path of the channel fine 'PATH/channel.mat', and applying the 'Allsubjects' option.
(I thought I had responded right away, I realise now that I did not send the response. Therefore apologises for the delay in my answer)
Thank you very much
best,
Elena