spm_voronoi.m 1.1 KB

12345678910111213141516171819202122232425
  1. function [vor, dist] = spm_voronoi(img, seeds, distance)
  2. % Geodesic Discrete Voronoi Diagram - a compiled routine
  3. % FORMAT [vor, dist] = spm_voronoi(img, seeds, distance)
  4. %
  5. % img - binary image: > 0 : inside
  6. % <= 0 : outside
  7. % seeds - {n x 3} array of the n seeds positions [in voxels]
  8. % distance - type of chamfer distance to use ('d4', 'd8', 'd34' or 'd5711')
  9. % (default is 'd34')
  10. %
  11. % vor - Geodesic Discrete Voronoi diagram
  12. % (label is equal to the index of the seed in 'seeds')
  13. % dist - Geodesic Distance map of img with seeds as objects
  14. %
  15. % Compute the geodesic discrete Voronoi Diagram of an image of labelled
  16. % objects using front propagation. The distance map is also available
  17. % on output.
  18. %__________________________________________________________________________
  19. % Copyright (C) 2008-2014 Wellcome Trust Centre for Neuroimaging
  20. % Guillaume Flandin
  21. % $Id: spm_voronoi.m 6079 2014-06-30 18:25:37Z spm $
  22. %-This is merely the help file for the compiled routine
  23. error('spm_voronoi.c not compiled - see Makefile')