Crates.io | rusty-psf |
lib.rs | rusty-psf |
version | |
source | src |
created_at | 2025-01-04 05:41:27.567093+00 |
updated_at | 2025-01-04 05:41:27.567093+00 |
description | A comprehensive Point Spread Function (PSF) library for microscopy and optical systems |
homepage | https://github.com/rusty-libraries/rusty-psf |
repository | https://github.com/rusty-libraries/rusty-psf |
max_upload_size | |
id | 1503678 |
Cargo.toml error: | TOML parse error at line 22, column 1 | 22 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
[!NOTE] This is a comprehensive Rust library for calculating Point Spread Functions (PSF) in microscopy and optical systems. It provides efficient implementations for various PSF models including Gaussian, defocus, and optical aberrations using Zernike polynomials.
[!TIP] Make sure you have Rust and Cargo installed on your system before proceeding. Visit rust-lang.org for installation instructions.
To use this library, add the following dependencies to your Cargo.toml
file:
[dependencies]
rusty-psf = "0.1.0"
ndarray = { version = "0.16.1", features = ["rayon"] }
num-complex = "0.4.6"
To get started with the Rusty-PSF library, follow these examples:
[!NOTE] Generate a theoretical Gaussian PSF with specified optical parameters:
use rusty_psf::{
types::OpticalParameters,
core::gaussian::create_theoretical_psf,
};
fn main() {
// Define optical parameters
let params = OpticalParameters {
na: 1.4, // Numerical aperture
wavelength: 0.532, // Wavelength in micrometers (green light)
refractive_index: 1.518, // Oil immersion
};
// Create a theoretical PSF
let size = 64; // Grid size
let pixel_size = 0.1; // Pixel size in micrometers
let psf = create_theoretical_psf(¶ms, size, pixel_size);
}
[!NOTE] Create a PSF with specific optical aberrations using Zernike polynomials:
use rusty_psf::{
types::OpticalParameters,
optics::{ZernikeMode, AberrationCoefficients, aberrated_psf},
};
fn main() {
let params = OpticalParameters::default();
// Define aberrations
let mut coeffs = AberrationCoefficients::new();
coeffs.set(ZernikeMode::Defocus, 0.5); // Defocus
coeffs.set(ZernikeMode::AstigmatismX, 0.25); // Astigmatism
// Generate aberrated PSF
let size = 64;
let pixel_size = 0.1;
let psf = aberrated_psf(size, &coeffs, ¶ms, pixel_size);
}
[!TIP] The library provides comprehensive PSF modeling capabilities:
[!NOTE] For detailed API documentation and examples, please refer to the Documentation.
[!IMPORTANT] This library is licensed under the BSD 3-Clause License. See the LICENSE file for details.