Commit df400382 authored by Jay Dubb's avatar Jay Dubb
Browse files

v1.25.4

-- Added error handling to group level and subject level user functions hmrG_SubjAvg.m and hmrS_RunAvg.m
parent 4ffc98f8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ On
on

% Data Storage Scheme
memory
files

% Auto Save Acquisition Files
No
+10 −2
Original line number Diff line number Diff line
@@ -23,11 +23,12 @@
function [yAvgOut, nTrials] = hmrG_SubjAvg(yAvgSubjs, nTrialsSubjs)

yAvgOut = DataClass().empty();
nDataBlks = length(yAvgSubjs{1});
nTrials = [];

nSubj = length(yAvgSubjs);
err = zeros(nDataBlks, length(yAvgSubjs));

for iBlk = 1:length(yAvgSubjs{1})
for iBlk = 1:nDataBlks
    
    subjCh = [];
    nStim = 0;
@@ -40,6 +41,7 @@ for iBlk = 1:length(yAvgSubjs{1})
        
        yAvg      = yAvgSubjs{iSubj}(iBlk).GetDataTimeSeries('reshape');
        if isempty(yAvg)
            err(iBlk, iSubj) = -1;
            continue;
        end
        
@@ -162,3 +164,9 @@ for iBlk = 1:length(yAvgSubjs{1})
    end
    nTrials{iBlk} = nT;
end


if all(err<0)
    MessageBox('Warning: All subject input to hmrG_SubjAvg.m is empty.')
end
+7 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ yAvgOut = DataClass().empty();

nDataBlks = length(yAvgRuns{1});
nTrials_tot = cell(nDataBlks,1);
err = zeros(nDataBlks, length(yAvgRuns));

for iBlk = 1:nDataBlks
    
@@ -37,6 +38,7 @@ for iBlk = 1:nDataBlks
        
        yAvg      = yAvgRuns{iRun}(iBlk).GetDataTimeSeries('reshape');
        if isempty(yAvg)
            err(iBlk, iRun) = -1;
            continue;
        end
        tHRF      = yAvgRuns{iRun}(iBlk).GetTime();
@@ -158,3 +160,7 @@ for iBlk = 1:nDataBlks
end
nTrials = nTrials_tot;

if all(err<0)
    MessageBox('Warning: All run input to hmrS_RunAvg.m is empty.')
end
+1 −1
Original line number Diff line number Diff line
function MessageBox(msg, title)
function hm = MessageBox(msg, title)

if nargin<2
    title = 'MessageBox';