Commit 664b35f6 authored by Meryem Ayse Yucel's avatar Meryem Ayse Yucel
Browse files

hmrG_t_paired

putting a check for tHRF range, if out of range, display a warning
parent 059fe003
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -21,12 +21,9 @@
% tHRFrange: [0, 0]
%
function  [hmrstatsG_base_cond] = hmrG_t_paired_baseline_HRF(yAvgSubjs, tHRFrange)
% N subject included per channel da gerekiyor.
% fix name hrmstatsG
hmrstatsG_base_cond = [];
nDataBlks = length(yAvgSubjs{1});
nSubj = length(yAvgSubjs);
% get number of conditions


for iBlk = 1:nDataBlks
@@ -42,6 +39,12 @@ for iBlk = 1:nDataBlks
            tHRF      = yAvgSubjs{iSubj}(iBlk).GetTime();
            fq = abs(1/(tHRF(1)-tHRF(2)));
            ml    = yAvgSubjs{iSubj}(iBlk).GetMeasListSrcDetPairs();
            
            % error check
            if tHRFrange(1)>max(tHRF) || tHRFrange(2)>max(tHRF) || tHRFrange(1)>tHRFrange(2)
                warning('tHRF range should be between 0 and tHRF max');
                return
            end
        end
        
        baseline_yAvg(iSubj,:,:,:) = mean(yAvg(round(fq*(tHRFrange(1) + abs(min(tHRF)))):round(fq*(tHRFrange(2) + abs(min(tHRF)))),:,:,:),1);
+6 −2
Original line number Diff line number Diff line
@@ -26,8 +26,6 @@
% c_vector: [0, 0]
%
function  [hmrstatsG_contrast] = hmrG_t_paired_contrast(yAvgSubjs, tHRFrange, c_vector)
% N subject included per channel da gerekiyor.
% fix name hrmstatsG
hmrstatsG_contrast = [];
nDataBlks = length(yAvgSubjs{1});
nSubj = length(yAvgSubjs);
@@ -45,6 +43,12 @@ if ~isempty(nCond)
                tHRF      = yAvgSubjs{iSubj}(iBlk).GetTime();
                fq = abs(1/(tHRF(1)-tHRF(2)));
                ml    = yAvgSubjs{iSubj}(iBlk).GetMeasListSrcDetPairs();
                
                % error check
                if tHRFrange(1)>max(tHRF) || tHRFrange(2)>max(tHRF) || tHRFrange(1)>tHRFrange(2)
                    warning('tHRF range should be between 0 and tHRF max');
                    return
                end
            end
            
            for iCond = nCond