32 #ifndef MLN_MORPHO_TREE_COMPONENT_TREE_HH
33 # define MLN_MORPHO_TREE_COMPONENT_TREE_HH
35 # include <mln/data/sort_psites.hh>
36 # include <mln/morpho/tree/data.hh>
54 template <
typename I,
typename N>
57 min_tree(
const Image<I>& f,
const Neighborhood<N>& nbh);
66 template <
typename I,
typename N>
69 max_tree(
const Image<I>& f,
const Neighborhood<N>& nbh);
72 # ifndef MLN_INCLUDE_ONLY
74 template <
typename I,
typename N>
77 min_tree(
const Image<I>& f_,
const Neighborhood<N>& nbh_)
79 mln_trace(
"morpho::tree::min_tree");
81 const I& f =
exact(f_);
84 mln_precondition(f.is_valid());
85 mln_precondition(nbh.is_valid());
87 typedef p_array<mln_psite(I)> S;
91 tree_t tree(f, s, nbh);
96 template <
typename I,
typename N>
99 max_tree(
const Image<I>& f_,
const Neighborhood<N>& nbh_)
101 mln_trace(
"morpho::tree::max_tree");
103 const I& f =
exact(f_);
104 const N& nbh =
exact(nbh_);
106 mln_precondition(f.is_valid());
107 mln_precondition(nbh.is_valid());
109 typedef p_array<mln_psite(I)> S;
113 tree_t tree(f, s, nbh);
118 # endif // ! MLN_INCLUDE_ONLY
126 #endif // !MLN_MORPHO_TREE_COMPONENT_TREE_HH