snaphu-sys

Crates.iosnaphu-sys
lib.rssnaphu-sys
version0.1.2
created_at2026-01-25 05:59:34.559748+00
updated_at2026-01-26 00:52:07.046436+00
descriptionLow-level Rust bindings to the SNAPHU C library
homepagehttps://github.com/vini-fda/snaphu-sys
repositoryhttps://github.com/vini-fda/snaphu-sys
max_upload_size
id2068230
size688,429
Vinícius Freitas de Almeida (vini-fda)

documentation

https://docs.rs/snaphu-sys

README

Rust FFI Bindings to SNAPHU

crates.io docs.rs

snaphu-sys provides low-level Rust bindings to the SNAPHU library, a C implementation of a statistical-cost, network-flow algorithm for two-dimensional phase unwrapping.

From their website:

Two-dimensional phase unwrapping is the process of recovering unambiguous phase values from data known only modulo $2 \pi$. SNAPHU formulates this problem as a maximum a posteriori (MAP) estimation task and solves it approximately using network-flow optimization techniques. The implementation includes statistical models tailored for topography, deformation, and smooth generic data, and is commonly used in InSAR and related geophysical applications.

This crate exposes the original SNAPHU C API, with slight modifications, via unsafe FFI bindings. It does not provide a safe or idiomatic Rust interface.

The upstream SNAPHU codebase targets Unix-like platforms, and these bindings target the upstream version 2.0.7 (February 2024).

License

This project includes code derived from SNAPHU and the cs2 minimum-cost flow solver.

The cs2 component is licensed for non-commercial / evaluation use only. As a result, this crate may not be used for commercial purposes.

See the original SNAPHU and cs2 documentation for full terms.

References

This library is based on the phase unwrapping algorithms developed by Curtis W. Chen and Howard A. Zebker, as described in the following publications:

  1. C. W. Chen and H. A. Zebker,Network approaches to two-dimensional phase unwrapping: intractability and two new algorithms,Journal of the Optical Society of America A, Vol. 17, pp. 401–414 (2000).
  2. C. W. Chen and H. A. Zebker,Two-dimensional phase unwrapping with use of statistical models for cost functions in nonlinear optimization,Journal of the Optical Society of America A, Vol. 18, pp. 338–351 (2001).
  3. C. W. Chen and H. A. Zebker,Phase unwrapping for large SAR interferograms: Statistical segmentation and generalized network models,IEEE Transactions on Geoscience and Remote Sensing, Vol. 40, pp. 1709–1719 (2002).
Commit count: 6

cargo fmt