nmr-schedule

Crates.ionmr-schedule
lib.rsnmr-schedule
version0.2.1
created_at2025-04-07 19:42:16.294924+00
updated_at2025-05-19 01:40:31.319614+00
descriptionAlgorithms for NMR Non-Uniform Sampling
homepagehttps://gitlab.com/hrovnyak/nmr-schedule
repositoryhttps://gitlab.com/hrovnyak/nmr-schedule
max_upload_size
id1624651
size168,634
Henry Rovnyak (Xendergo)

documentation

README

nmr-schedule

Documentation Crates.io License

This crate implements algorithms for Non-Uniform Sampling in NMR spectroscopy.

This crate primarily implements algorithms for generating and filtering sampling schedules. It includes various base schedules along with various post-processing filters for schedules.

This library currently only supports 1D schedules, however there are plans to support higher dimensional schedules in the future and the architecture is already generic over dimension.

Examples

// Generate a 64x256 schedule with Quantiles with QSin weighting, 8 points backfill, and TMPF filtering
let sched = Quantiles::new(|len| qsin(len, QSinBias::Low, 3.))
    .fill_corners(|_, _| [8, 1]) // Any function of the count and length of the schedule
    .tm_filter()
    .polish_psf(0.1, 0.32, DisplayMode::Abs)
    .generate(64, Ix1(256));

println!("{sched}");
// Apply TMPF filtering to an existing schedule
let sched_encoded = "0\n1\n2\n5\n7\n9\n20";
let sched =
    Schedule::decode(sched_encoded, EncodingType::ZeroBased, |dim| Ok(dim)).unwrap();

let filtered =
    PSFPolisher::new(0.1, 0.32, DisplayMode::Abs).filter(TMFilter::new().filter(sched));

let encoded = filtered.encode(EncodingType::ZeroBased);
println!("{encoded}");
Commit count: 106

cargo fmt