Abstract
Binary partition hierarchies (BPH) and minimum spanning trees are essential data structures for hierarchical analysis, such as quasi-flat zones and watershed segmentation. Traditional BPH construction algorithms are limited by their requirement to load the data entirely into memory, making them impractical for processing large images whose processing exceeds the capacity of the computer’s main memory. To overcome this limitation, an algebraic framework was introduced, enabling the out-of-core computation of BPH leveraging three key operations: select, join, and insert. In this publication, we present two distinct calculi based on these operations: one designed for general spatial partitions and another optimized for causal partitioning. The second calculus is specifically tailored to meet out-of-core constraints, ensuring efficient processing of large-scale data. We provide detailed algorithms, including pseudo-code and complexity analysis, and conduct experimental comparisons between the two approaches.

















Similar content being viewed by others
Data Availability
No datasets were generated or analysed during the current study.
References
Salembier, P., Garrido, L.: Binary partition tree as an efficient representation for image processing, segmentation, and information retrieval. TIP 9(4), 561–576 (2000). https://doi.org/10.1109/83.841934
Randrianasoa, J.F., Kurtz, C., Désjardin, É., Passat, N.: Binary partition tree construction from multiple features for image segmentation. Pattern Recognit. 84, 237–250 (2018). https://doi.org/10.1016/j.patcog.2018.07.003
Cousty, J., Najman, L., Perret, B.: Constructive links between some morphological hierarchies on edge-weighted graphs. In: ISMM, pp. 86–97 (2013). https://doi.org/10.1007/978-3-642-38294-9_8
Najman, L., Cousty, J., Perret, B.: Playing with Kruskal: algorithms for morphological trees in edge-weighted graphs. In: ISMM, pp. 135–146 (2013).https://doi.org/10.1007/978-3-642-38294-9_12
Meyer, F., Maragos, P.: Morphological scale-space representation with levelings. In: International Conference on Scale-Space Theories in Computer Vision, pp. 187–198 (1999).https://doi.org/10.1007/3-540-48236-9_17
Meyer, F.: The dynamics of minima and contours. In: ISMM, pp. 329–336 (1996).https://doi.org/10.1007/978-1-4613-0469-2_38
Baum, D., Weaver, J.C., Zlotnikov, I., Knötel, D., Tomholt, L., Dean, M.N.: High-Throughput Segmentation of Tiled Biological Structures using Random-Walk Distance Transforms. Integr. Compar. Biology 59(6), 1700–1712 (2019). https://doi.org/10.1093/icb/icz117
Soares, A.P., Baum, D., Hesse, B., Kupsch, A., Müller, B.R., Zaslansky, P.: Scattering and phase-contrast x-ray methods reveal damage to glass fibers in endodontic posts following dental bur trimming. Dental Mater. 37(2), 201–211 (2021). https://doi.org/10.1016/j.dental.2020.10.018
Paiva, P.V.V., Cogima, C.K., Dezen-Kempter, E., Carvalho, M.A.G.: Historical building point cloud segmentation combining hierarchical watershed transform and curvature analysis. Pattern Recognit. Lett. 135, 114–121 (2020). https://doi.org/10.1016/j.patrec.2020.04.010
Le Moigne, B., Rault, C., Guiotte, F., Thomas, D.J., Dewez, T.: RIDIM: Unveiling Rock Instabilities through Hierarchical Segmentation of 3D Point Clouds. 14th International Symposium on Landslides. Poster (2024)
K C, S., Aryal, J., Ryu, D.: Automated delineation of the agricultural fields using multi-task deep learning and optical satellite imagery. In: IGARSS 2023 - 2023 IEEE International Geoscience and Remote Sensing Symposium, pp. 2795–2798 (2023). https://doi.org/10.1109/IGARSS52108.2023.10282141
Maia, D.S., Pham, M.-T., Lefévre, S.: Watershed-based attribute profiles with semantic prior knowledge for remote sensing image analysis. IEEE J. Select. Top. Appl. Earth Observations Remote Sens. 15, 2574–2591 (2022). https://doi.org/10.1109/JSTARS.2022.3153110
Vitter, J.S.: External memory algorithms and data structures: dealing with massive data. ACM Comput. Surv. 33(2), 209–271 (2001). https://doi.org/10.1145/384192.384193
Wang, S., Zhang, M., Yang, K., Chen, K., Ma, S., Jiang, J., Wu, Y.: Noswalker: A decoupled architecture for out-of-core random walk processing. In: ACM International Conference on Architectural Support for Programming Languages and Operating Systems, pp. 466–482. ACM, New York, NY, USA (2023). https://doi.org/10.1145/3582016.3582025
Arge, L., Danner, A., Haverkort, H., Zeh, N.: I/O-Efficient Hierarchical Watershed Decomposition of Grid Terrain Models, pp. 825–844. Springer, Berlin, Heidelberg (2006). https://doi.org/10.1007/3-540-35589-8_51
Danner, A., Mølhave, T., Yi, K., Agarwal, P.K., Arge, L., Mitasova, H.: Terrastream: From elevation data to watershed hierarchies. In: ACM Symposium on Advances in Geographic Information Systems, pp. 212–219 (2007).https://doi.org/10.1145/1341012.1341049
Lindstrom, P., Pascucci, V.: Terrain simplification simplified: a general framework for view-dependent out-of-core visualization. IEEE Trans. Visualization Comput. Graphics 8(3), 239–254 (2002). https://doi.org/10.1109/TVCG.2002.1021577
Toledo, S.: A survey of out-of-core algorithms in numerical linear algebra, pp. 161–179. American Mathematical Society, USA (1999). https://doi.org/10.1090/dimacs/050
Gazagnes, S., Wilkinson, M.H.F.: Distributed connected component filtering and analysis in 2d and 3d tera-scale data sets. IEEE Trans. Image Process. 30, 3664–3675 (2021). https://doi.org/10.1109/TIP.2021.3064223
Götz, M., Cavallaro, G., Geraud, T., Book, M., Riedel, M.: Parallel computation of component trees on distributed memory machines. TPDS 29(11), 2582–2598 (2018). https://doi.org/10.1109/TPDS.2018.2829724
Kazemier, J.J., Ouzounis, G.K., Wilkinson, M.H.: Connected morphological attribute filters on distributed memory parallel machines. In: ISMM, pp. 357–368 (2017). https://doi.org/10.1007/978-3-319-57240-6_29
Gigli, L., Velasco-Forero, S., Marcotegui, B.: On minimum spanning tree streaming for hierarchical segmentation. PRL 138, 155–162 (2020). https://doi.org/10.1016/j.patrec.2020.07.006
Havel, J., Merciol, F., Lefèvre, S.: Efficient tree construction for multiscale image representation and processing. JRTIP 16(4), 1129–1146 (2019). https://doi.org/10.1007/s11554-016-0604-0
Carlinet, E., Blin, N., Lemaitre, F., Lacassagne, L., Geraud, T.: Max-tree computation on GPUs. IEEE TPDS (2022). https://doi.org/10.1109/TPDS.2022.3158488
Perrin, R., Leborgne, A., Passat, N., Naegel, B., Wemmert, C.: Multi-scale component-tree: A hierarchical representation for sparse objects. In: DGMM, pp. 312–324. Springer, Cham (2024). https://doi.org/10.1007/978-3-031-57793-2_24
Cousty, J., Perret, B., Phelippeau, H., Carneiro, S., Kamlay, P., Buzer, L.: An algebraic framework for out-of-core hierarchical segmentation algorithms. In: DGMM, pp. 378–390 (2021).https://doi.org/10.1007/978-3-030-76657-3_27
Lefèvre, J., Cousty, J., Perret, B., Phelippeau, H.: Join, select, and insert: Efficient out-of-core algorithms for hierarchical segmentation trees. In: Discrete Geometry and Mathematical Morphology, pp. 274–286. Springer, Cham (2022).https://doi.org/10.1007/978-3-031-19897-7_22
Perret, B., Chierchia, G., Cousty, J., Guimarães, S.J.F., Kenmochi, Y., Najman, L.: Higra: Hierarchical graph analysis. SoftwareX 10, 100335 (2019). https://doi.org/10.1016/j.softx.2019.100335
Najman, L., Cousty, J.: A graph-based mathematical morphology reader. Pattern Recognit. Lett. 47, 3–17 (2014). https://doi.org/10.1016/j.patrec.2014.05.007
Passat, N., Kurtz, C., Vacavant, A.: Editorial - virtual special issue: “hierarchical representations: New results and challenges for image analysis’’. Pattern Recognit. Lett. 138, 201–203 (2020). https://doi.org/10.1016/j.patrec.2020.07.019
Bosilj, P., Kijak, E., Lefévre, S.: Partition and inclusion hierarchies of images: A comprehensive survey. J. Imaging (2018). https://doi.org/10.3390/jimaging4020033
Salembier, P., Oliveras, A., Garrido, L.: Antiextensive connected operators for image and sequence processing. IEEE Trans. Image Process. 7(4), 555–570 (1998). https://doi.org/10.1109/83.663500
Matas, P., Dokládalová, E., Akil, M., Grandpierre, T., Najman, L., Poupa, M., Georgiev, V.: Parallel algorithm for concurrent computation of connected component tree. In: Advanced Concepts for Intelligent Vision Systems, pp. 230–241. Springer, Berlin, Heidelberg (2008). https://doi.org/10.1007/978-3-540-88458-3_21
Wilkinson, M.H.F., Hui Gao, Hesselink, W.H., Jonker, J.-E., Meijster, A.: Concurrent computation of attribute filters on shared memory parallel machines 30(10), 1800–1813https://doi.org/10.1109/TPAMI.2007.70836 . Accessed 2023-03-17
Ouzounis, G.K., Soille, P.: Pattern spectra from partition pyramids and hierarchies. In: Soille, P., Pesaresi, M., Ouzounis, G.K. (eds.) Mathematical Morphology and Its Applications to Image and Signal Processing, pp. 108–119. Springer, ??? (2011). https://doi.org/10.1007/978-3-642-21569-8_10
Havel, J., Merciol, F., Lefèvre, S.: Efficient schemes for computing \(\alpha \)-tree representations. In: Mathematical Morphology and Its Applications to Signal and Image Processing, pp. 111–122. Springer, Berlin, Heidelberg (2013).https://doi.org/10.1007/978-3-642-38294-9_10
Ronse, C.: Partial partitions, partial connections and connective segmentation. JMIV 32(2), 97–125 (2008). https://doi.org/10.1007/s10851-008-0090-5
Group, T.H.: Hierarchical Data Format, Version 5. https://github.com/HDFGroup/hdf5
Miles, A., Kirkham, J., Durant, M., Bourbeau, J., Onalan, T., Hamman, J., Patel, Z., shikharsg, Rocklin, M., dussin, Schut, V., Andrade, E.S., Abernathey, R., Noyes, C., sbalmer, bot, Tran, T., Saalfeld, S., Swaney, J., Moore, J., Jevnik, J., Kelleher, J., Funke, J., Sakkis, G., Barnes, C., Banihirwe, A.: Zarr-developers/zarr-python: V2.4.0. https://doi.org/10.5281/zenodo.3773450
Lucchi, A., Smith, K., Achanta, R., Knott, G., Fua, P.: Supervoxel-based segmentation of mitochondria in EM image stacks with learned shape features. IEEE Trans. Med. Imag. 31(2), 474–486 (2012). https://doi.org/10.1109/TMI.2011.2171705
Acknowledgements
This work was supported by the French ANR grant ANR-20-CE23-0019.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The authors declare no competing interests.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendices
Appendix A Proof of Property 7
Before proving Property 7, let us first introduce some lemmas.
Lemma 12
Let \(A\) and \(B\) be two disjoint subsets of \(V\) and let \(A^\prime \) and \(B^\prime \) be two subsets of \(A\) and \(B\), respectively, then we have:
Lemma 13
Let \(A\) and \(B\) be two disjoint subsets of \(V\) and \(Z\) be a set such as \(Z \cap A \ne \emptyset \) and \(Z \cap B \ne \emptyset \). Then we have: \(\text{ select }\left( {Z},{\text{ join }\left( {{\mathcal {B}}^\prec _A},~{{\mathcal {B}}^\prec _B} \right) }\right) = {\text {j}oin} \left( {\text{ select }\left( {Z\cap A},{{\mathcal {B}}^\prec _A}\right) }\right. \left. {\text{ select }\left( {Z\cap B},{{\mathcal {B}}^\prec _B}\right) }\right) \)
Proof
(of Lemma 13) Let \({\mathcal {H}} = \text{ select }\left( {Z},{\text{ join }\left( {{\mathcal {B}}^\prec _A},~{{\mathcal {B}}^\prec _B} \right) }\right) \). We are going to prove that \({\mathcal {H}} = {\text {j}oin} \left( { \text{ select }\left( {Z\cap A},{{\mathcal {B}}^\prec _A}\right) }\right. \left. {\text{ select }\left( {Z\cap B},{{\mathcal {B}}^\prec _B}\right) }\right) \). We have
From Property 7.3 of [26], we have
Since \(Z\cap A \subseteq A\) and \(Z\cap B \subseteq B\), by Lemma 12 we deduce that:
\(\square \)
At initialization step of Algorithm 1, we have \({\mathcal {M}}_0 = \text{ select }\left( { \gamma ^\bullet _{{V {\setminus } S_{0} }}({S_0})},{{\mathcal {B}}^\prec _{S_{0}}}\right) \). Then at the first iteration we have
By recurrence, we have
Then, if we consider a partition into \(k+1\) regions, when \(i=k\) we have
This latter rewriting fits Definition 6. \(\square \)
Appendix B Proof of Lemma 8
Proof
(of statement 1) At each step of the first loop of Algorithm 3, we have \({\mathcal {M}}^\uparrow = {\text {j}oin} \left( { \text{ select }\left( {\gamma ^\bullet _{{i}}({S_{i-1}})},{B^\uparrow _{i-1}}\right) }\right. \left. { \text{ select }\left( {\gamma ^\bullet _{{{i-1}}}({S_i})},{B^\prec _{S_i}}\right) }\right) \). Theorem 17 of [26] states that \(B^\uparrow _{i-1} = \text{ select }\left( {S_i},{{\mathcal {B}}^\prec _{\cup \{S_j \; | \;j \in \{0, \ldots i\}\}}}\right) \). Then, since \(\delta ^\bullet (\gamma (S_{i\text {-}1},S_{i}))\cap \gamma ^\bullet _{{i}}({S_{i-1}}) \subseteq \gamma ^\bullet _{{i}}({S_{i-1}})\) and \(\delta ^\bullet (\gamma (S_{i\text {-}1},S_{i}))\cap \gamma ^\bullet _{{{i-1}}}({S_i}) \subseteq \gamma ^\bullet _{{{i-1}}}({S_i})\), by Lemma 13 we can deduce that \({\mathcal {M}}^\uparrow = \text{ select }\left( {\delta ^\bullet (\gamma (S_{i\text {-}1},S_{i}))},{{\mathcal {B}}^\prec _{\cup \{S_j \; | \;j \in \{0, \ldots i\}\}}}\right) \) \(\square \)
Proof
(of statement 2) Let \(A\), \(B\) and \(C\) be three pairwise disjoint subsets of \(V\) such that \(\gamma (A,C)=\emptyset \). Let \({\mathcal {M}}^\uparrow = \text{ join }\left( { \text{ select }\left( { \gamma ^\bullet _{{B}}({A}) },{ {\mathcal {B}}^\prec _{A} }\right) },~{ \text{ select }\left( { \gamma ^\bullet _{{B}}({A}) },{ {\mathcal {B}}^\prec _{A} }\right) } \right) \) and \({\mathcal {M}}^\downarrow = \text{ insert }({ \text{ select }\left( { \gamma ^\bullet _{{B}}({A}) },{ {\mathcal {B}}^\prec _{A\cup B \cup C} }\right) },{ {\mathcal {M}}^\uparrow })\). Then we have
Since \(\gamma ^\bullet _{{B}}({A}) \cup \gamma ^\bullet _{{A}}({B}) = \delta ^\bullet (\gamma (A,B))\), we have \({\mathcal {M}}^\downarrow =\text {select}\left( \delta ^\bullet (\gamma (A,B)), {\mathcal {B}}^\prec _{A \cup B \cup C} \right) \). \(\square \)
Appendix C Proof of Property 9
Proof
In order to establish Property 9, we first introduce the following lemma:
Lemma 14
Let \({\mathcal {H}}\) be a BPH on \(V\). Let \(A \subseteq V\) and \(B \subseteq V\) such that \(A \subseteq B\). The we have \(\text{ select }\left( {A},{{\mathcal {H}}}\right) \sqsubseteq \text{ select }\left( {B},{{\mathcal {H}}}\right) \).
Then, we proceed in two steps:
-
(1)
\({\mathcal {M}}^\uparrow _i \sqsubseteq {\mathcal {M}}_i\); and
-
(2)
\({\mathcal {M}}^\downarrow _i \sqsubseteq {\mathcal {M}}\).
(1) As stated in Sect. 4.3, \({\mathcal {M}}_i\) built on \({\textbf{P}}\) is defined as follows
where
From the definition of \(\delta ^\bullet \), \(\gamma \) and \(\gamma ^\bullet \), it can be seen that
As stated in Property 8, we have
where
We can deduce that for any \(i \in \{1, \ldots , k\}\) we have \(C \subseteq F\). Therefore, given Lemma 14 we have \( {\mathcal {M}}^\uparrow _i \sqsubseteq {\mathcal {M}}_i \).
(2) For this second statement, we can express \({\mathcal {M}}\) and \({\mathcal {M}}_i\) with \(C\) from Equation (C6) and \(F\) from Equation (C4).
We have \(C \subseteq F\), and with Lemma 14 we have \( {\mathcal {M}}^\downarrow \sqsubseteq {\mathcal {M}} \). \(\square \)
Appendix D Proof of Property 11
Proof
Given \(n_i = |\text{ select }\left( {S_{i -1}},{{\mathcal {H}}}\right) |\ + |\text{ select }\left( {S_{i}},{{\mathcal {H}}}\right) |\), we will prove statements of Property 11 in the following order:
-
(1)
\(|{\mathcal {M}}^\downarrow _i |\le n_i\); and
-
(2)
\(|{\mathcal {M}}^\uparrow _i |\le n_i\).
(1) From Property 8, we have \({\mathcal {M}}^\downarrow _i = \text{ select }\left( {F},{{\mathcal {H}}}\right) \) where \(F = \delta ^\bullet (\gamma (S_{i\text {-}1},S_{i}))\). We can see that \(F \subseteq (S_{i-1} \cup S_i)\) which gives us Equation (D9). Each region \(R\) of \(\text{ select }\left( {S_{i-1} \cup S_i},{ {\mathcal {H}}}\right) \) either intersects an element of \(S_{i -1}\) or \(S_i\) or both. As a result, \(R\) belongs either to \(\text{ select }\left( {S_{i -1}},{{\mathcal {H}}}\right) \) or \(\text{ select }\left( {S_{i}},{{\mathcal {H}}}\right) \) or both. As a result, we have Equation (D10).
(2) Given \(C=\delta ^\bullet (\gamma (S_{i-1}, S_i))\), we can write the two structures as follows:
Considering Lemma 15, we have \(|{\mathcal {M}}^\uparrow _i |\le |{\mathcal {M}}^\downarrow _i |\). Thus we have \(|{\mathcal {M}}^\uparrow _i |\le |{\mathcal {M}}^\downarrow _i |\le n_i\)
Lemma 15
Let \((S_0, \ldots , S_k)\) be a causal partition of V, \(A \subseteq V\) and \(u\) be a pair of distinct elements of \(V\). For any \(i \in \{0,\ldots ,k\}\), the following inequalities holds true:
\(\square \)
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Lefèvre, J., Cousty, J., Perret, B. et al. Out-of-core Algorithms for Binary Partition Hierarchies. J Math Imaging Vis 67, 18 (2025). https://doi.org/10.1007/s10851-025-01234-0
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s10851-025-01234-0