Minimal path extraction using the fast marching method
Project description
scikit-mpe
scikit-mpe is a package for extracting a minimal path in n-dimensional Euclidean space (on regular Cartesian grids) using the fast marching method.
Quickstart
Here is a simple example that demonstrates how to extract the path passing through the retina vessel.
from matplotlib import pyplot as plt
from skimage.data import retina
from skimage.color import rgb2gray
from skimage.transform import rescale
from skimage.filters import sato
from skmpe import mpe
image = rescale(rgb2gray(retina()), 0.5)
speed_image = sato(image)
start_point = (76, 388)
end_point = (611, 442)
way_points = [(330, 98), (554, 203)]
path_info = mpe(speed_image, start_point, end_point, way_points)
px, py = path_info.path[:, 1], path_info.path[:, 0]
plt.imshow(image, cmap='gray')
plt.plot(px, py, '-r')
plt.plot(*start_point[::-1], 'oy')
plt.plot(*end_point[::-1], 'og')
for p in way_points:
plt.plot(*p[::-1], 'ob')
plt.show()
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
scikit-mpe-0.1.0.tar.gz
(10.6 kB
view hashes)
Built Distribution
scikit_mpe-0.1.0-py3-none-any.whl
(11.3 kB
view hashes)
Close
Hashes for scikit_mpe-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 846cf4d7133f2253d620bddc8b41e99a5adfb3b92be009a8eb854832cb3f8076 |
|
MD5 | f78d963a38c0f7adcb18b5035c26c48e |
|
BLAKE2b-256 | bb43260ab55dea0b07e1d0b826ed16e0b36939ccff4dde8698a73169168806b7 |