26 #ifndef MLN_MAKE_W_WINDOW3D_HH
27 # define MLN_MAKE_W_WINDOW3D_HH
36 # include <mln/core/w_window.hh>
37 # include <mln/core/alias/dpoint3d.hh>
55 template <
typename W,
unsigned M>
59 # ifndef MLN_INCLUDE_ONLY
61 template <
typename W,
unsigned M>
66 int h =
unsigned(std::pow(
float(M),
float(1. / 3))) / 2;
67 mln_precondition((2 * h + 1) * (2 * h + 1) * (2 * h + 1) == M);
70 for (
int sli = - h; sli <= h; ++sli)
71 for (
int row = - h; row <= h; ++row)
72 for (
int col = - h; col <= h; ++col)
74 const W& cur = weights[i];
77 tmp.
insert(cur, dpoint3d(sli, row, col));
83 # endif // ! MLN_INCLUDE_ONLY
90 #endif // ! MLN_MAKE_W_WINDOW3D_HH