-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathonetwo3D_script.m
99 lines (72 loc) · 2.65 KB
/
onetwo3D_script.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
%% Select pins from module1 only in a certain range
if 0
lowrange=2000;
highrange=2500;
mod_module1.a=[];
for i=1:length(module1.a(1,1,:))
if ((module1.a(1,1,i)+module1.a(1,2,i))/2)<highrange && ((module1.a(1,1,i)+module1.a(1,2,i))/2)>lowrange
mod_module1.a=cat(3,mod_module1.a,module1.a(:,:,i));
end
end
mod_module1.b=[];
for i=1:length(module1.b(1,1,:))
if ((module1.b(1,1,i)+module1.b(1,2,i))/2)<highrange && ((module1.b(1,1,i)+module1.b(1,2,i))/2)>lowrange
mod_module1.b=cat(3,mod_module1.b,module1.b(:,:,i));
end
end
mod_module1.c=[];
for i=1:length(module1.c(1,1,:))
if ((module1.c(1,1,i)+module1.c(1,2,i))/2)<highrange && ((module1.c(1,1,i)+module1.c(1,2,i))/2)>lowrange
mod_module1.c=cat(3,mod_module1.c,module1.c(:,:,i));
end
end
mod_module1.d=[];
for i=1:length(module1.d(1,1,:))
if ((module1.d(1,1,i)+module1.d(1,2,i))/2)<highrange && ((module1.d(1,1,i)+module1.d(1,2,i))/2)>lowrange
mod_module1.d=cat(3,mod_module1.d,module1.d(:,:,i));
end
end
mod_module1.e=[];
for i=1:length(module1.e(1,1,:))
if ((module1.e(1,1,i)+module1.e(1,2,i))/2)<highrange && ((module1.e(1,1,i)+module1.e(1,2,i))/2)>lowrange
mod_module1.e=cat(3,mod_module1.e,module1.e(:,:,i));
end
end
module1.a=mod_module1.a;
module1.b=mod_module1.b;
module1.c=mod_module1.c;
module1.d=mod_module1.d;
module1.e=mod_module1.e;
% module1.a=module1.a(:,:,[10]);
% module1.b=module1.b(:,:,[8]);
% module1.c=module1.c(:,:,[]);
% module1.d=module1.d(:,:,[]);
% module1.e=module1.e(:,:,[]);
%
% module1.c=zeros(3,2);
% module1.d=zeros(3,2);
% module1.e=zeros(3,2);
end
%% Place endpoints in 3D space
tic
endpoints.a=Place3D(module1.a, theta.a, geo);
endpoints.b=Place3D(module1.b, theta.b, geo);
endpoints.c=Place3D(module1.c, theta.c, geo);
endpoints.d=Place3D(module1.d, theta.d, geo);
endpoints.e=Place3D(module1.e, theta.e, geo);
time.Place3D=toc
% endpoints(:,:,i)=[ [x1;y1;z1] , [x2;y2;z2] , [sourceX;sourceY;sourceZ] ];
% where z1>z2. [meters]
%% Initiate PHASE1 Parallel search and find algorithm
tic
[ PHASE1_OUT , PHASE1_DIAGNOSTICS ] = PHASE1_Parallel_Find( endpoints, contrast, theta, threshold, geo, 0);
time.find=toc
%% Eliminate pins that are outside of the silo using max and min i data points from module 1
tic
[ PHASE2_OUT , PHASE2_DIAGNOSTICS , eliminate] = PHASE2_Eliminate_Outsiders( PHASE1_OUT , PHASE1_DIAGNOSTICS ,theta, module1, silo_boundary, geo, 0);
time.eliminate_outsiders=toc
%% Eliminate false positives and extra pins by overlap logic
tic
[ PHASE3_OUT , PHASE3_DIAGNOSTICS , eliminate_data] = PHASE3_Eliminate_Overlaps( ...
PHASE2_OUT , PHASE2_DIAGNOSTICS , threshold );
time.eliminate_overlaps=toc