Skip to main content
. Author manuscript; available in PMC: 2017 Jul 1.
Published in final edited form as: IEEE Trans Biomed Eng. 2015 Oct 26;63(7):1426–1439. doi: 10.1109/TBME.2015.2494838

Algorithm 1.

Initial ROI Segmentation
1: Inputs: seed set S, filtered image I
2: // Initialize data structures
3: for all pI do
4:   Compute F (p) using (1011)
5:   if pS then
6:     T (p) = 0, R(p) = 1
7:   else
8:     T (p) = ∞, R(p) = 0
9: S → ℒ // Begin the heap
10: Tc = To = 0
11: while ℒ ≠ ∅ do
12:   // Make heap’s top pixel, which has min T (p), alive
13:   pop(ℒ) → p, Alive(p) = TRUE
14:   Tc = T (p), ΔR = 0
15:   // Locate pixels constituting R
16:   if TcTo ≥ 2 then
17:     TR = To + 1
18:     for all qI such that R(q) ≠ 1 do
19:       if T (q) ≤ TR then
20:         R(q) = 1
21:     exit
22:   else if TcTo ≥ 1 then
23:     TR = Tc
24:     for all qI such that R(q) ≠ 1 do
25:       if T (q) ≤ TR then
26:         R(q) = 1, ΔR = ΔR + 1
27:     if ΔR ≤ Δmin then
28:       exit // Avoid potential ROI leakage
29:   else
30:     To = Tc
31:   // Check 4-neighbors of p
32:   for all q ∈ 𝒩(p) such that ¬Alive(q) do
33:     Compute T (q) using (eq:FastMarching) // Update arrival time
34:     if q ∉ ℒ then
35:       q → ℒ // Add to heap
36:   heap-sort(ℒ) // Resort the heap
37: fill-holes(R) → R // Fill holes in final output
38: return R