Skip to content

Commit

Permalink
Process: Handle time vector, when extracting time with time-bands file
Browse files Browse the repository at this point in the history
  • Loading branch information
rcassani committed Nov 26, 2024
1 parent ba154f9 commit 5ce5e9f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/license.html
Original file line number Diff line number Diff line change
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.241122 (22-Nov-2024)<br>
<!-- LICENCE_START -->Version: 3.241126 (26-Nov-2024)<br>
<span style="font-style: italic;">COPYRIGHT &copy; 2000-2024
USC &amp; McGill University.<br>
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/version.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
% Brainstorm
% v. 3.241122 (22-Nov-2024)
% v. 3.241126 (26-Nov-2024)
12 changes: 11 additions & 1 deletion toolbox/process/bst_process.m
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,17 @@
end
% Output time vector
if isfield(sMat, 'TimeBands') && ~isempty(sMat.TimeBands)
% Time bands: Do not update time vector
if isTimeChange
% Find time bands related to new time vector (obtained from time bands)
timeVectorBands = mean(process_tf_bands('GetBounds', sMat.TimeBands), 2);
ixTimeBandKeep = (timeVectorBands >= OutTime(1)) & (timeVectorBands <= OutTime(end));
sMat.TimeBands = sMat.TimeBands(ixTimeBandKeep, :);
% Update original time vector to match new time vector range
ixTimeDel = (sMat.Time < OutTime(1)) | (sMat.Time > OutTime(end));
sMat.Time(ixTimeDel) = [];
else
% Time bands: Do not update time vector
end
else
sMat.Time = OutTime;
end
Expand Down

0 comments on commit 5ce5e9f

Please sign in to comment.