GPU Computation of the Euler Characteristic Curve for Imaging Data

Authors Fan Wang, Hubert Wagner, Chao Chen

Thumbnail PDF


  • Filesize: 1.1 MB
  • 16 pages

Document Identifiers

Author Details

Fan Wang
  • Stony Brook University, NY, US
Hubert Wagner
  • University of Florida, Gainesville, FL, US
Chao Chen
  • Stony Brook University, NY, US

Cite AsGet BibTex

Fan Wang, Hubert Wagner, and Chao Chen. GPU Computation of the Euler Characteristic Curve for Imaging Data. In 38th International Symposium on Computational Geometry (SoCG 2022). Leibniz International Proceedings in Informatics (LIPIcs), Volume 224, pp. 64:1-64:16, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2022)


Persistent homology is perhaps the most popular and useful tool offered by topological data analysis - with point-cloud data being the most common setup. Its older cousin, the Euler characteristic curve (ECC) is less expressive - but far easier to compute. It is particularly suitable for analyzing imaging data, and is commonly used in fields ranging from astrophysics to biomedical image analysis. These fields are embracing GPU computations to handle increasingly large datasets. We therefore propose an optimized GPU implementation of ECC computation for 2D and 3D grayscale images. The goal of this paper is twofold. First, we offer a practical tool, illustrating its performance with thorough experimentation - but also explain its inherent shortcomings. Second, this simple algorithm serves as a perfect backdrop for highlighting basic GPU programming techniques that make our implementation so efficient - and some common pitfalls we avoided. This is intended as a step towards a wider usage of GPU programming in computational geometry and topology software. We find this is particularly important as geometric and topological tools are used in conjunction with modern, GPU-accelerated machine learning frameworks.

Subject Classification

ACM Subject Classification
  • Theory of computation → Computational geometry
  • Mathematics of computing → Combinatorial algorithms
  • topological data analysis
  • Euler characteristic
  • Euler characteristic curve
  • Betti curve
  • persistent homology
  • algorithms
  • parallel programming
  • algorithm engineering
  • GPU programming
  • imaging data


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Robert J. Adler and A. M. Hasofer. Level Crossings for Random Fields. The Annals of Probability, 4(1):1-12, 1976. URL:
  2. Erik J Amezquita, Michelle Quigley, Tim Ophelders, Jacob Landis, Elizabeth Munch, Daniel Chitwood, and Daniel Koenig. Quantifying barley morphology using the Euler characteristic transform. In NeurIPS 2020 Workshop on Topological Data Analysis and Beyond, 2020. Google Scholar
  3. Aldo Badano, Christian G. Graff, Andreu Badal, Diksha Sharma, Rongping Zeng, Frank W. Samuelson, Stephen J. Glick, and Kyle J. Myers. Evaluation of Digital Breast Tomosynthesis as Replacement of Full-Field Digital Mammography Using an In Silico Imaging Trial. JAMA Network Open, 1(7):e185474-e185474, November 2018. URL:
  4. Omer Bobrowski and Primoz Skraba. Homological percolation and the Euler characteristic. Phys. Rev. E, 101:032304, March 2020. URL:
  5. Lorin Crawford, Anthea Monod, Andrew X Chen, Sayan Mukherjee, and Raúl Rabadán. Predicting clinical outcomes in glioblastoma: an application of topological and functional data analysis. Journal of the American Statistical Association, 115(531):1139-1150, 2020. Google Scholar
  6. Herbert Edelsbrunner, David Letscher, and Afra Zomorodian. Topological persistence and simplification. In Proceedings 41st annual symposium on foundations of computer science, pages 454-463. IEEE, 2000. Google Scholar
  7. J Richard Gott III, Adrian L Melott, and Mark Dickinson. The sponge-like topology of large-scale structure in the universe. The Astrophysical Journal, 306:341-357, 1986. Google Scholar
  8. Teresa Heiss and Hubert Wagner. Streaming algorithm for Euler characteristic curves of multidimensional images. In Michael Felsberg, Anders Heyden, and Norbert Krüger, editors, Computer Analysis of Images and Patterns - 17th International Conference, CAIP 2017, Ystad, Sweden, August 22-24, 2017, Proceedings, Part I, volume 10424 of Lecture Notes in Computer Science, pages 397-409. Springer, 2017. URL:
  9. Berthold Horn, Berthold Klaus, and Paul Horn. Robot vision. The MIT Press, 1986. Google Scholar
  10. Xiaoling Hu, Fuxin Li, Dimitris Samaras, and Chao Chen. Topology-preserving deep image segmentation. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. Google Scholar
  11. Tomasz Kaczynski, Konstantin Mischaikow, and Marion Mrozek. Computational homology. Bull. Amer. Math. Soc, 43:255-258, 2006. Google Scholar
  12. Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097-1105, 2012. Google Scholar
  13. Xiaqing Li, Guangyan Zhang, H Howie Huang, Zhufan Wang, and Weimin Zheng. Performance analysis of GPU-based convolutional neural networks. In 2016 45th International conference on parallel processing (ICPP), pages 67-76. IEEE, 2016. Google Scholar
  14. Dmitri I. Novikov, Hume A. Feldman, and Sergei F. Shandarin. Minkowski functionals and cluster analysis for CMB maps. International Journal of Modern Physics D, 08(03):291-306, 1999. URL:
  15. A Odgaard and HJG Gundersen. Quantification of connectivity in cancellous bone, with special emphasis on 3-D reconstructions. Bone, 14(2):173-182, 1993. Google Scholar
  16. Johanna Pasquet, Emmanuel Bertin, Marie Treyer, Stéphane Arnouts, and Dominique Fouchez. Photometric redshifts from SDSS images using a convolutional neural network. Astronomy & Astrophysics, 621:A26, 2019. Google Scholar
  17. Shubhabrata Sengupta, Mark Harris, Michael Garland, et al. Efficient parallel scan algorithms for GPUs. NVIDIA, Santa Clara, CA, Tech. Rep. NVR-2008-003, 1(1):1-17, 2008. Google Scholar
  18. L. Snidaro and G. L. Foresti. Real-time thresholding with Euler numbers. Pattern Recogn. Lett., 24(9–10):1533-1544, June 2003. URL:
  19. Nima Tajbakhsh, Jae Y Shin, Suryakanth R Gurudu, R Todd Hurst, Christopher B Kendall, Michael B Gotway, and Jianming Liang. Convolutional neural networks for medical image analysis: Full training or fine tuning? IEEE transactions on medical imaging, 35(5):1299-1312, 2016. Google Scholar
  20. Hubert Wagner, Chao Chen, and Erald Vuçini. Efficient computation of persistent homology for cubical data. In Topological methods in data analysis and visualization II, pages 91-106. Springer, 2012. Google Scholar
  21. Fan Wang, Saarthak Kapse, Steven Liu, Prateek Prasanna, and Chao Chen. TopoTxR: A Topological Biomarker for Predicting Treatment Response in Breast Cancer. In Information Processing in Medical Imaging - 27th International Conference, IPMI, volume 12729 of Lecture Notes in Computer Science, pages 386-397. Springer, 2021. URL:
  22. Fan Wang, Huidong Liu, Dimitris Samaras, and Chao Chen. TopoGAN: A Topology-Aware Generative Adversarial Network. In Computer Vision – ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part III, pages 118-136. Springer-Verlag, 2020. URL:
  23. Keith J Worsley. The geometry of random images. Chance, 9(1):27-40, 1996. Google Scholar
  24. Pengxiang Wu, Chao Chen, Yusu Wang, Shaoting Zhang, Changhe Yuan, Zhen Qian, Dimitris Metaxas, and Leon Axel. Optimal Topological Cycles and Their Application in Cardiac Trabeculae Restoration. In In International Conference on Information Processing in Medical Imaging (IPMI), 2017, pages 80-92, May 2017. URL:
  25. Simon Zhang, Mengbai Xiao, and Hao Wang. GPU-Accelerated Computation of Vietoris-Rips Persistence Barcodes. In 36th International Symposium on Computational Geometry (SoCG 2020). Schloss Dagstuhl-Leibniz-Zentrum für Informatik, 2020. Google Scholar
  26. Djemel Ziou and Madjid Allili. Generating cubical complexes from image data and computation of the Euler number. Pattern Recognition, 35(12):2833-2839, 2002. Pattern Recognition in Information Systems. URL:
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail