Skip to main content
. Author manuscript; available in PMC: 2019 Sep 1.
Published in final edited form as: Comput Biol Med. 2018 Jul 7;100:209–220. doi: 10.1016/j.compbiomed.2018.07.004

Table 4.

Algorithm of two-sided pointwise surface distance (PSD) calculation

Input: Binary mask dataset of A, B.
Output: PSD(S(A), S(B))
1 S(A) = {a1, a2, …, an} ← Edge extraction of A;
2 S(B) = {b1, b2, …, bm} ← Edge extraction of B;
3 Compute one-sided PSD from A to B
4 for each Point a in S (A) do
5 d(a, S(B)) ← The minimum distance from a to S(B);
6   if aB then
7    α ← +1; //Overestimation of PSM
8   else aB then
9    α ← −1; //Underestimation of PSM
10   end if
11 dg(a, S(B)) ← αd(a, S(B));
12 end for
13 g(S(A),S(B))i=1ndg(a,S(B))/n;
14 Compute one-sided PSD from B to A
15 for each Point b in S(B) do
16 d(b, S(A)) ← The minimum distance from b to S(A);
17   if b ∉ A then
18    β ← +1; //Overestimation of PSM
19   else b ∈ A then
20    β ← −1; //Underestimation of PSM
21   end if
22 dg(b, S(A)) ← βd(b, S(A));
23   end for
24 g(S(B),S(A))i=1mdg(b,S(A))/m;
25 Compute two-sided PSD index of A and B
26 PSD(S(A), S(B)) ← 0.5 {g(S(A), S(B)) + (S(B), S(A))}
27 Return PSD(S(A), S(B));