-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgetWindowOfInterest.m
50 lines (47 loc) · 1.38 KB
/
getWindowOfInterest.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
function woi = getWindowOfInterest(userdata, varargin)
% GETWINDOWOFINTERST Returns the window of interest
%
% Usage:
% woi = getWindowOfInterest( userdata )
% Where:
% userdata - see importcarto_mem
% woi - two-element array specifying the window of interest relative to
% the reference annotation
%
% GETWINDOWOFINTEREST accepts the following parameter-value pairs
% 'iEgm' {:} | integer | array
% - The electrogram point(s) for which the window of interst is required
%
% Author: Steven Williams (2020) (Copyright)
% SPDX-License-Identifier: Apache-2.0
%
% Modifications -
%
% Info on Code Testing:
% ---------------------------------------------------------------
% woi = getWindowOfInterest(userdata)
% woi = getWindowOfInterest(userdata, 'iEgm', 1)
% ---------------------------------------------------------------
%
% ---------------------------------------------------------------
% code
% ---------------------------------------------------------------
nStandardArgs = 1;
iEgm = ':';
if nargin > nStandardArgs
for i = 1:2:nargin-nStandardArgs
switch lower(varargin{i})
case 'iegm'
iEgm = varargin{i+1};
end
end
end
woi = [];
if isstr(iEgm) && strcmpi(iEgm, ':')
woi = userdata.electric.annotations.woi;
else
for i = 1:numel(iEgm)
woi(i,1:2) = userdata.electric.annotations.woi(iEgm(i),1:2);
end
end
end