Skip to content

Commit

Permalink
Bugfix: Connectivity mishandling dims TF metrics with one freq band
Browse files Browse the repository at this point in the history
  • Loading branch information
rcassani committed Nov 16, 2023
1 parent c5ffb02 commit 1b19f1d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion doc/license.html
Expand Up @@ -5,7 +5,7 @@
<body alink="#fff000" link="#fff000" vlink="#fff000">
<h4><span style="font-family: Arial Black; color: #ffffff;"><strong>THERE IS NO UNDO BUTTON!<BR>SET UP A <FONT color=red>BACKUP</FONT> OF YOUR DATABASE</strong></span></h4>
<HR>
<!-- LICENCE_START -->Version: 3.231109 (09-Nov-2023)<br>
<!-- LICENCE_START -->Version: 3.231116 (16-Nov-2023)<br>
<span style="font-style: italic;">COPYRIGHT &copy; 2000-2023
USC &amp; McGill University.<br>
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/version.txt
@@ -1,2 +1,2 @@
% Brainstorm
% v. 3.231109 (09-Nov-2023)
% v. 3.231116 (16-Nov-2023)
13 changes: 8 additions & 5 deletions toolbox/connectivity/bst_connectivity.m
Expand Up @@ -959,6 +959,14 @@
end
% Add the number of averaged windows & files to the report
nWinLenSamples = nWinLenAvg;
elseif strcmp(OPTIONS.TimeRes, 'none')
% Add time dimension
for f = 1:numel(Terms)
% Insert a singleton second-to-last dimension
order = 1 : (length(size(S.(Terms{f}))) + 1);
newOrder = [order(1:end-2), order(end:-1:end-1)];
S.(Terms{f}) = permute(S.(Terms{f}), newOrder);
end
end
% Initial R or Accumulate R
if isempty(R) || strcmpi(OPTIONS.OutputMode, 'input')
Expand Down Expand Up @@ -1191,11 +1199,6 @@
R(isnan(R(:))) = 0;
end
end
% Static measures may need to be reshaped to add singleton time dimension.
if ndims(R) == 3
% Push freq to 4th dim.
R = permute(R, [1,2,4,3]);
end
end

%% ===== APPLY FINAL MEASURE =====
Expand Down

0 comments on commit 1b19f1d

Please sign in to comment.