27 #ifndef MLN_TOPO_SKELETON_BREADTH_FIRST_THINNING_HH
28 # define MLN_TOPO_SKELETON_BREADTH_FIRST_THINNING_HH
42 # include <mln/core/routine/duplicate.hh>
44 # include <mln/core/concept/image.hh>
45 # include <mln/core/concept/neighborhood.hh>
47 # include <mln/core/site_set/p_queue_fast.hh>
49 # include <mln/topo/no_constraint.hh>
51 # include <mln/data/fill.hh>
81 template <
typename I,
typename N,
typename F,
typename G,
typename H>
105 template <
typename I,
typename N,
typename F,
typename G>
113 # ifndef MLN_INCLUDE_ONLY
115 template <
typename I,
typename N,
typename F,
typename G,
typename H>
124 mln_trace(
"topo::skeleton::breadth_first_thinning");
126 const I& input =
exact(input_);
127 const N& nbh =
exact(nbh_);
128 F& is_simple =
exact(is_simple_);
129 const H& constraint =
exact(constraint_);
131 mln_concrete(I) output =
duplicate(input);
133 is_simple.set_image(output);
134 detach.set_image(output);
137 typedef mln_psite(I)
psite;
141 mln_ch_value(I,
bool) in_queue;
146 mln_piter(I)
p(output.domain());
149 if (output(
p) && constraint(
p) && is_simple(
p))
156 while (!queue.is_empty())
158 psite
p = queue.pop_front();
160 if (output(p) && constraint(p) && is_simple(p))
163 mln_niter(N) n(nbh, p);
166 if (output.domain().has(n)
167 && output(n) && constraint(n) && is_simple(n)
181 template <
typename I,
typename N,
typename F,
typename G>
196 # endif // MLN_INCLUDE_ONLY
204 #endif // ! MLN_TOPO_SKELETON_BREADTH_FIRST_THINNING_HH