Distance transforms for ndarrays
npm install distance-transformdistance-transform
==================
Distance transforms for Lp metrics on binary ndarrays. This code is based on Meijster's algorithm. For more information see:
* https://github.com/parmanoir/Meijster-distance
* http://dissertations.ub.rug.nl/FILES/faculties/science/2004/a.meijster/c2.pdf

``javascript
//Generate some shape as a binary voxel image
var x = require("zeros")([256, 256])
x.set(128, 128, 1)
//Distance transform x in the Euclidean metric
require("distance-transform")(x)
//Save result
require("save-pixels")(x, "png").pipe(process.stdout)
`
#### Output

npm install distance-transform
Performs a distance transform of array in place using Meijster's algorithm.*
array is the array to transform
* p is the exponent for the metric. (Default 2)For different values of p you get different transforms
*
p = 1 gives the Manhattan/taxicab distance metric
* p = 2 gives the Euclidean distance metric
* p = Infinity gives the Chebyshev/chessboard distance metric
* Other values of p give various interpolantsarray` is updated in place and gets the distance values.