Skip to main content
. Author manuscript; available in PMC: 2015 Jan 1.
Published in final edited form as: IEEE Trans Biomed Eng. 2013 Aug 15;61(1):119–130. doi: 10.1109/TBME.2013.2277936

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
    QQ ⋃ {(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)
     QQ ⋃ {(c, x, v)}
        end for
      end if
    end while
  return pred
end function