@@ -127,10 +127,10 @@ function seeded_region_growing(img::AbstractArray{CT,N}, seeds::AbstractVector{<
127127
128128 # Get the pixels with minimum δ from `pq` and add them to `holdingq` and their labels to `labelsq`
129129 if ! isempty (pq)
130- δ_min = peek (pq)[2 ]
130+ δ_min = first (pq)[2 ]
131131 end
132- while (! isempty (pq) && isapprox (peek (pq)[2 ], δ_min)) # , atol=1e-8))
133- p = cil[dequeue ! (pq)]
132+ while (! isempty (pq) && isapprox (first (pq)[2 ], δ_min)) # , atol=1e-8))
133+ p = cil[popfirst ! (pq)[ 1 ] ]
134134 @assert result[p] <= 0
135135 @inbounds imgp = img[p]
136136 mindifflabel = - 1
@@ -262,12 +262,12 @@ function unseeded_region_growing(img::AbstractArray{CT,N}, threshold::Real, neig
262262 # Enqueue neighouring points of `start_point`
263263 for p in neighbourhood (start_point)
264264 if p != start_point && checkbounds (Bool, img, p) && result[p] == - 1
265- enqueue ! (neighbours, lic[p], diff_fn (region_means[result[start_point]], img[p]))
265+ push ! (neighbours, lic[p] => diff_fn (region_means[result[start_point]], img[p]))
266266 end
267267 end
268268
269269 while ! isempty (neighbours)
270- point = cil[dequeue ! (neighbours)]
270+ point = cil[popfirst ! (neighbours)[ 1 ] ]
271271 δ = Inf
272272 minlabel = - 1
273273 pixelval = img[point]
@@ -322,7 +322,7 @@ function unseeded_region_growing(img::AbstractArray{CT,N}, threshold::Real, neig
322322 δ = min (δ, diff_fn (region_means[result[tp]], img[p]))
323323 end
324324 end
325- enqueue ! (neighbours, lic[p], δ)
325+ push ! (neighbours, lic[p] => δ)
326326 end
327327 end
328328
0 commit comments