-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetEvents.m
More file actions
30 lines (22 loc) · 970 Bytes
/
getEvents.m
File metadata and controls
30 lines (22 loc) · 970 Bytes
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
function eventArray = getEvents(cellStruct)
% label other positions as 0
% proximal osteo 1
% proximal vascular 2
% contact osteo 3
% contact vascular 4
other = ~(cellStruct.vascularProximal + cellStruct.osteoProximal + ...
cellStruct.vascularContact + cellStruct.osteoContact);
proximal = cellStruct.vascularProximal | cellStruct.osteoProximal;
% proximalVascular = cellStruct.vascularDistSmooth(proximal)<...
% cellStruct.osteoDistSmooth(proximal);
distCompare = cellStruct.vascularDistSmooth<...
cellStruct.osteoDistSmooth;
contact = cellStruct.vascularContact | cellStruct.osteoContact;
% contactVascular = cellStruct.vascularDistSmooth(contact)<...
% cellStruct.osteoDistSmooth(contact);
eventArray = zeros(1,length(cellStruct.times));
eventArray(other) = 1;
eventArray(proximal&distCompare) = 3;
eventArray(proximal&~distCompare) = 2;
eventArray(contact&distCompare) = 5;
eventArray(contact&~distCompare) = 4;