| Crates.io | sci-gaussfilt-rs |
| lib.rs | sci-gaussfilt-rs |
| version | 0.1.0 |
| created_at | 2025-12-05 15:28:49.064399+00 |
| updated_at | 2025-12-05 15:28:49.064399+00 |
| description | A Rust implementation of the 1D Gaussian filter matching SciPy's behavior. |
| homepage | |
| repository | https://github.com/Beneficial01/sci-gaussfilt-rs |
| max_upload_size | |
| id | 1968428 |
| size | 72,376 |
A Rust implementation of the 1D Gaussian filter that exactly matches the behavior of scipy.ndimage.gaussian_filter1d.
This crate provides a high-performance, pure Rust implementation of the Gaussian filter for 1D arrays, supporting various boundary conditions and floating-point types (f32, f64). It is designed to be a drop-in replacement for SciPy's implementation in Rust applications.
scipy.ndimage.gaussian_filter1d output within floating-point tolerance (1e-6 or better).Reflect, Nearest, and Constant padding modes.f32 and f64 data types.Add this to your Cargo.toml:
[dependencies]
sci-gaussfilt-rs = "0.1.0"
use sci_gaussfilt_rs::{gaussian_filter1d, types::BoundaryMode};
fn main() {
let data = vec![1.0, 2.0, 3.0, 4.0, 5.0];
let sigma = 1.0;
let truncate = 4.0;
// Apply Gaussian filter with Reflect boundary mode
let result = gaussian_filter1d(&data, sigma, truncate, BoundaryMode::Reflect).unwrap();
println!("Filtered data: {:?}", result);
}
BoundaryMode::Reflect: (Default in SciPy) d c b a | a b c d | d c b aBoundaryMode::Nearest: a a a a | a b c d | d d d dBoundaryMode::Constant(value): v v v v | a b c d | v v v vMIT