26 #ifndef MLN_TOPO_CONNECTIVITY_NUMBER_3D_HH
27 # define MLN_TOPO_CONNECTIVITY_NUMBER_3D_HH
34 # include <mln/core/concept/image.hh>
36 # include <mln/value/int_u8.hh>
37 # include <mln/value/int_u32.hh>
39 # include <mln/core/alias/neighb3d.hh>
40 # include <mln/make/box3d.hh>
42 # include <mln/core/image/image3d.hh>
43 # include <mln/core/image/vmorph/fun_image.hh>
44 # include <mln/core/image/dmorph/image_if.hh>
45 # include <mln/fun/v2b/lnot.hh>
46 # include <mln/labeling/blobs.hh>
48 # include <mln/math/abs.hh>
103 template <
typename I>
124 template <
typename I>
141 template <
typename I>
148 # ifndef MLN_INCLUDE_ONLY
164 local_configuration(const
Image<I>& ima_, const mln_psite(I)&
p,
167 const I& ima =
exact(ima_);
170 mln_concrete(I) ima_local(b, 0);
174 mln_niter(
neighb3d) n_local(c26(), center);
175 for_all_2(n_ima, n_local)
176 if (ima.has(n_ima) && ima(n_ima) == ref_val)
177 ima_local(n_local) = true;
197 bool operator()(
const point3d& p)
const {
return f_within_c18(p); }
209 mlc_equal(mln_value(I),
bool)::check();
211 mln_concrete(I) ima_local =
212 internal::local_configuration(ima, p, ref_val);
222 std::set<conn_number_t> s;
224 mln_niter(neighb3d) n(nbh, center);
238 mlc_equal(mln_value(I),
bool)::check();
240 mln_concrete(I) ima_local =
241 internal::local_configuration(ima, p, ref_val);
245 neighb3d nbh = c26();
246 conn_number_t number;
258 mlc_equal(mln_value(I),
bool)::check();
260 mln_concrete(I) ima_local =
261 internal::local_configuration(ima, p, ref_val);
266 conn_number_t unused_nl;
267 image3d<conn_number_t> lab =
labeling::
blobs(ima_local, nbh, unused_nl);
268 std::set<conn_number_t> s;
270 mln_niter_(neighb3d) n(nbh, center);
284 mlc_equal(mln_value(I),
bool)::check();
286 mln_concrete(I) ima_local =
287 internal::local_configuration(ima, p, ref_val);
291 neighb3d nbh =
c18();
292 conn_number_t unused_nl;
293 image3d<conn_number_t> lab =
labeling::
blobs(ima_local, nbh, unused_nl);
294 std::set<conn_number_t> s;
296 mln_niter_(neighb3d) n(nbh, center);
303 # endif // MLN_INCLUDE_ONLY
309 #endif // ! MLN_TOPO_CONNECTIVITY_NUMBER_3D_HH