|
Algorithm 1 Path calculation algorithm. |
|
input: cost image C
|
input: set of start point(s) S
|
input: local path length parameter lmax
|
output: map with predecessor points on path pred
|
function CalculatePaths(C, S) |
▷ Initialize |
Q ← empty priority queue |
for each voxel v in C do
|
pred[v] ← undefined
|
end for
|
for each point v in S do
|
pred[v] = root
|
for each neighbor x of v do
|
Q ← Q ⋃ {(C[x], x, v)} |
end for
|
end for
|
▷ Extend paths |
while Q is not empty do
|
tuple t ← popmin(Q) |
v ← second(t) |
if pred[v]= undefined then
|
pred[v] ← third(t) |
for each neighbor x of v do
|
c ← LocalPathCosts (C, pred, v, x) |
Q ← Q ⋃ {(c, x, v)} |
end for
|
end if
|
end while
|
return pred
|
end function
|
|