项目作者: espdev

项目描述 :
Minimal path extraction using the fast marching method
高级语言: Python
项目地址: git://github.com/espdev/scikit-mpe.git
创建时间: 2020-01-30T00:52:55Z
项目社区:https://github.com/espdev/scikit-mpe

开源协议:MIT License

下载


scikit-mpe

PyPI version
Build status
Documentation Status
Coverage Status
Supported Python versions
License

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

Installing

  1. pip install -U scikit-mpe

Usage

Here is a simple example that demonstrates how to extract the path passing through the retina vessels.

  1. from matplotlib import pyplot as plt
  2. from skimage.data import retina
  3. from skimage.color import rgb2gray
  4. from skimage.transform import rescale
  5. from skimage.filters import sato
  6. from skmpe import mpe
  7. image = rescale(rgb2gray(retina()), 0.5)
  8. speed_image = sato(image)
  9. start_point = (76, 388)
  10. end_point = (611, 442)
  11. way_points = [(330, 98), (554, 203)]
  12. path_info = mpe(speed_image, start_point, end_point, way_points)
  13. px, py = path_info.path[:, 1], path_info.path[:, 0]
  14. plt.imshow(image, cmap='gray')
  15. plt.plot(px, py, '-r')
  16. plt.plot(*start_point[::-1], 'oy')
  17. plt.plot(*end_point[::-1], 'og')
  18. for p in way_points:
  19. plt.plot(*p[::-1], 'ob')
  20. plt.show()

retina_vessel_path

Documentation

The full documentation can be found at scikit-mpe.readthedocs.io

References

License

MIT