Tree of Shapes (ToS) ==================== Include :file:`` .. cpp:namespace:: mln::morpho .. cpp:function:: Image{I} auto tos(I f, image_point_t pinf) Compute the ToS and returns a pair `(tree, node_map)`. See :doc:`component_tree` for more information about the representation of tree. The value_type of the image must be an unsigned integral. It only handles regular 2D or 3D domains. .. note:: Note that the size of the image is twice the original image size. :param input: The input image :param pinf: Rooting point :return: A pair `(tree, node_map)` where *tree* is of type `component_tree>` and :precondition: ``f.domain().has(pinf)`` .. rubric:: Requirements * ``image_value_t`` is a :cpp:concept:`UnsignedIntegral` * ``image_domain_t`` is :cpp:any:`mln::box2d` or :cpp:any:`mln::box3d` .. rubric:: Example :: #include #include mln::image2d input = ...; auto [tree, node_map] = mln::morpho::tos(input); Notes ----- Complexity ---------- The algorithm is linear and requires :math:`O(n)` extra-memory space. References ----------