Skip to main content
. Author manuscript; available in PMC: 2025 Aug 25.
Published in final edited form as: Int Workshop Topol Graph Inf Imaging Inform (2024). 2024 Oct 11;15239:100–110. doi: 10.1007/978-3-031-73967-5_10

Algorithm 1:

P-Count

Input: A 3D soft lesion probability map, and a threshold θ
Output: Number of lesions
Definition: G = (V, E) denote a graph; f(v) is the intensity value of node v; lower_star(v)={(u,v)∈E∣f(u)<f(v)}; cc(v) is the connected component id of node v.
 1: PD=∅; Build the proximity graph (6-connectivity) for 3D image;
 2: U=V sorted according to f(v); T a sub-graph, which includes all the nodes and edges whose value < t.
 3: for v in U do
 4:   t=f(v),T=T+{v}
 5:   for (u, v) in lower_star(v) do
 5:     Assert u∈T
 6:     if cc(u)=cc(v) then
 6:      Continue
 7:     else
 7:      younger_cc=argmaxw=cc(u),cc(v)f(w)
 7:      older_cc=argminw=cc(u),cc(v)f(w)
 7:      pers=t-f(younger_cc)
 8:      if pers<=θ then
 9:       for w in younger_cc do
 9:        cc(w)=older_cc
10:      end for
11:     end if
11:     PD=PD+(f(younger_cc),t)
12:    end if
13:   end for
14: end for
15: return # of lesions = len(cc).