|
|
Algorithm 1 New Seed Detection Algorithm |
|
|
Input:
Icolor: original image; L ← Ø; V(x) ← 0, ∀x; parameters (ρ(r), {si}, α, β, D1, D2) |
|
Output:
L: a list of seeds for cells
|
| 1: |
{Initialization Phase} |
| 2: |
Decouple Icolor into two stain channels: hematoxylin IH and eosin IE
|
| 3: |
Construct mask image: Ψ ← complement(IH) and marker image: Φ ← IH ⊕ ρ
|
| 4: |
Compute reconstructed image
|
| 5: |
Compute difference image
|
| 6: |
Igray(x) ← rgb2Gray(Icolor); M(x) ← otusuThresholding(Igray(x)) |
| 7: |
{Voting Map Construction} |
| 8: |
for all
i ∈ (1, 2, …, N) do
|
| 9: |
for all x ∈ Ω do
|
| 10: |
λ2 (x) ← eigHessian(Δ(x), si) |
| 11: |
if sign(λ2(x))< 0 then
|
| 12: |
V(x) ← V(x) + 1 |
| 13: |
{Detecting and Merging Seeds} |
| 14: |
vsort ← descentSort(V(x)); v0→1 ← flip(normalize(vsort)) |
| 15: |
Let vc and vp be the current and previous voting value in vsort
|
| 16: |
for all
vc and vp ∈ vsort, where vc ← vsort(i) do
|
| 17: |
find objects 𝒪(vc) ← label(V(x) ≥ vc) |
| 18: |
for all
o ∈ 𝒪(vc) do
|
| 19: |
if size(o)≥ A(α, β, vi) = β + exp(αv0→1 (i)) && M(centroid(o)) = 1 && o ∩ L = Ø then
|
| 20: |
L ← L ∪ {centroid(o)} |
| 21: |
while any(L.pairwiseDistance() ≤ D1)=true do
|
| 22: |
find p ∈ L s.t. any(L.pairwiseDistance(p) ≤ D1) = true && sum(L.pairwiseDistance(p)) ≤ sum(L.pairwiseDistance(p′)) ∀p′ ∈ L
|
| 23: |
find Q = {q| s.t. (L.pairwiseDistance(p, q) ≤ D1) = true} |
| 24: |
L ← L ∪ Mean({p} ∪ Q) |
| 25: |
L ← L \ ({p} ∪ Q) |
| 26: |
{Merging Seeds with Edge Information} |
| 27: |
while any(L.pairwiseDistance() ≤ D2 && !L.isBlockedByEdge()) = true do
|
| 28: |
for all
p ∈ L
do
|
| 29: |
find Q(p) = {q| s.t. (L.pairwiseDistance(p, q) ≤ D2 && !L.isBlockedByEdge(p, q)) = true} |
| 30: |
find p ∈ L s.t. Q(p) ∆ Ø && sum(L.pairwiseDistance(p, Q(p))) ≤ sum(L.pairwiseDistance(p′,Q(p′))) ∀p′ ∈ L
|
| 31: |
L ← L ∪ Mean({p} ∪ Q(p)) |
| 32: |
L ← L \ ({p} ∪ Q(p)) |
|