Skip to content

rusty-libraries/rusty-psf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rusty-PSF: Point Spread Function Library

Crates.io docs.rs License

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.

Table of Contents

Installation

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"

Getting Started

To get started with the Rusty-PSF library, follow these examples:

Basic PSF Generation

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(&params, size, pixel_size);
}

Optical Aberrations

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, &params, pixel_size);
}

Features

Tip

The library provides comprehensive PSF modeling capabilities:

  • 🔬 Gaussian PSF with theoretical parameters
  • 🎯 Defocus and through-focus series
  • 🌊 Zernike polynomial-based aberrations
  • 📊 Efficient FFT implementations
  • 📐 Strehl ratio calculations
  • 🔄 Normalized coordinate systems
  • ⚡ Parallel processing support
  • 🧮 High-performance numerical computations

Documentation

Note

For detailed API documentation and examples, please refer to the Documentation.

License

Important

This library is licensed under the BSD 3-Clause License. See the LICENSE file for details.

About

A comprehensive Point Spread Function (PSF) library for microscopy and optical systems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages