27 #ifndef MLN_LABELING_RELABEL_HH
28 # define MLN_LABELING_RELABEL_HH
35 # include <mln/core/concept/image.hh>
37 # include <mln/make/relabelfun.hh>
39 # include <mln/data/transform.hh>
40 # include <mln/data/transform_inplace.hh>
59 template <
typename I,
typename F>
62 const mln_value(I)& nlabels,
63 mln_value(I)& new_nlabels,
64 const Function_v2b<F>& fv2b);
75 template <typename I, typename F>
78 const mln_value(I)& nlabels,
79 const Function_v2v<F>& fv2v);
88 template <typename I, typename F>
91 const mln_value(I)& nlabels,
92 const Function_v2b<F>& fv2b);
101 template <typename I, typename F>
104 const mln_value(I)& nlabels,
105 const Function_v2v<F>& fv2v);
108 # ifndef MLN_INCLUDE_ONLY
115 template <
typename I>
117 relabel_tests(
const Image<I>& label,
118 mln_value(I)& new_nlabels)
122 mln_precondition(exact(label).is_valid());
127 template <
typename I,
typename F>
129 relabel_tests(
const Image<I>& label,
130 const mln_value(I)& nlabels,
131 mln_value(I)& new_nlabels,
132 const Function<F>& f)
136 mln_precondition(exact(label).is_valid());
143 template <
typename I,
typename F>
145 relabel_tests(
const Image<I>& label,
146 const mln_value(I)& nlabels,
147 const Function<F>& f)
151 mln_precondition(exact(label).is_valid());
157 template <
typename I,
typename F>
160 relabel_inplace_tests(Image<I>& label,
161 const mln_value(I)& nlabels,
162 const Function<F>& f)
166 mln_precondition(exact(label).is_valid());
176 template <
typename I,
typename F>
180 const mln_value(I)& nlabels,
183 trace::entering(
"labeling::relabel");
186 mlc_not_equal(mln_result(F),
bool)::check();
187 internal::relabel_tests(label, nlabels, fv2v);
191 trace::exiting(
"labeling::relabel");
197 template <
typename I,
typename F>
201 const mln_value(I)& nlabels,
202 mln_value(I)& new_nlabels,
205 trace::entering(
"labeling::relabel");
207 internal::relabel_tests(label, nlabels, new_nlabels, fv2b);
209 typedef fun::i2v::array<mln_value(I)> fv2v_t;
213 trace::exiting(
"labeling::relabel");
218 template <
typename I,
typename F>
222 const mln_value(I)& nlabels,
225 trace::entering(
"labeling::relabel_inplace");
227 mlc_not_equal(mln_result(F),
bool)::check();
228 internal::relabel_inplace_tests(label, nlabels, fv2v);
232 trace::exiting(
"labeling::relabel_inplace");
237 template <
typename I,
typename F>
241 const mln_value(I)& nlabels,
244 trace::entering(
"labeling::relabel_inplace");
246 internal::relabel_inplace_tests(label, nlabels, fv2b);
248 typedef fun::i2v::array<mln_value(I)> fv2v_t;
253 trace::exiting(
"labeling::relabel_inplace");
256 # endif // ! MLN_INCLUDE_ONLY
263 #endif // ! MLN_LABELING_RELABEL_HH