Skip to content

Commit

Permalink
Bug fix: Added TFmask management ft_freqstatistics
Browse files Browse the repository at this point in the history
  • Loading branch information
ftadel committed Dec 20, 2018
1 parent 07a3954 commit 599ccc3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/license.html
Expand Up @@ -3,7 +3,7 @@

</head>
<body alink="#fff000" link="#fff000" vlink="#fff000">
<!-- LICENCE_START -->Version: 3.4 (19-Dec-2018)<br>
<!-- LICENCE_START -->Version: 3.4 (20-Dec-2018)<br>
<span style="font-style: italic;">COPYRIGHT &copy; 2000-2018
USC &amp; McGill University.<br>
</span>
Expand Down
2 changes: 1 addition & 1 deletion doc/version.txt
@@ -1,2 +1,2 @@
% Brainstorm
% v. 3.4 181219 (19-Dec-2018)
% v. 3.4 181220 (20-Dec-2018)
4 changes: 2 additions & 2 deletions toolbox/gui/figure_timefreq.m
Expand Up @@ -1030,8 +1030,8 @@ function UpdateFigurePlot(hFig, isForced)
% If the edge effects map is available from the time-frequency file
if ~isempty(GlobalData.DataSet(iDS).Timefreq(iTf).TFmask)
TFmask = GlobalData.DataSet(iDS).Timefreq(iTf).TFmask;
% Else: If the options of the wavelets were saved in the file
elseif ~isempty(GlobalData.DataSet(iDS).Timefreq(iTf).Options)
% Else: If the options of the wavelets were saved in the file (not for stat files)
elseif ~isempty(GlobalData.DataSet(iDS).Timefreq(iTf).Options) && ~strcmpi(file_gettype(TfInfo.FileName), 'ptimefreq')
TFmask = process_timefreq('GetEdgeEffectMask', Time, Freqs, GlobalData.DataSet(iDS).Timefreq(iTf).Options);
end
end
Expand Down
13 changes: 12 additions & 1 deletion toolbox/process/functions/process_ft_freqstatistics.m
Expand Up @@ -139,6 +139,9 @@
iTime = panel_time('GetTimeIndices', TimefreqMat.Time, OPT.TimeWindow);
ftAllFiles{i}.powspctrm = ftAllFiles{i}.powspctrm(:,iTime,:);
ftAllFiles{i}.time = ftAllFiles{i}.time(iTime);
if ~isempty(TimefreqMat.TFmask)
TimefreqMat.TFmask = TimefreqMat.TFmask(:,iTime);
end
end
% Save time vector for output
if (i == 1)
Expand All @@ -151,6 +154,13 @@
if (length(OutTime) == 1)
OutTime = OutTime + [0, 1/sfreq];
end
TFmask = TimefreqMat.TFmask;
% Following files
else
% Combine TFmasks
if ~isempty(TFmask) && isequal(size(TFmask), size(TimefreqMat.TFmask))
TFmask = TFmask & TimefreqMat.TFmask;
end
end
% Absolue value
if OPT.isAbsolute
Expand Down Expand Up @@ -285,7 +295,8 @@
sOutput.Correction = OPT.Correction;
sOutput.ColormapType = 'stat2';
sOutput.DisplayUnits = 't';

sOutput.TFmask = TFmask;

% Save clusters
if isfield(ftStat, 'posclusters')
sOutput.StatClusters.posclusters = ftStat.posclusters;
Expand Down

0 comments on commit 599ccc3

Please sign in to comment.