A sequential algorithm for computing the distance map using distances based on neighbourhood sequences (of any length) in Z³ is presented. Conditions for the algorithm to produce correct results are derived using a path-based approach.