26 #include <mln/core/image/image3d.hh>
27 #include <mln/core/alias/neighb3d.hh>
28 #include <mln/make/box3d.hh>
30 #include "tools/connectivity_numbers_3d.hh"
35 #define MLN_INCLUDE_ONLY
36 # include "tools/simple_point3d_lut_26_6.hh"
37 #undef MLN_INCLUDE_ONLY
51 typedef mln_domain_(I) B;
52 typedef mln_psite_(I) P;
54 B b = make::
box3d(-1,-1,-1, 1,1,1);
59 const
unsigned dim = 3;
60 const
unsigned max_nneighbs = mlc_pow_int(3, dim) - 1;
61 const
unsigned nconfigs = mlc_pow_int(2, max_nneighbs);
66 int exit_status = EXIT_SUCCESS;
77 mln_fwd_niter_(N) n(nbh, p);
88 conn_number_t conn_number_fg = connectivity_number_3d__26_6_one(fg_ima);
89 conn_number_t conn_number_bg = connectivity_number_3d__6_26_one(bg_ima);
90 bool conn_number_computed = conn_number_fg == 1 &&conn_number_bg == 1;
106 size_t cell = pos / 8;
109 unsigned char pack = mln::topo::simple_point3d_lut_26_6[cell];
114 size_t offset = pos % 8;
115 unsigned char mask = 1 << offset;
120 bool result = pack & mask;
121 conn_number_from_lut = result;
125 if (conn_number_computed != conn_number_from_lut)
128 <<
"Inconsistency for the " << i <<
"-th configuration: "
129 << conn_number_computed <<
" != " << conn_number_from_lut
131 exit_status = EXIT_FAILURE;