Expand description
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.
Schedulers implemented:
Filters implemented:
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}");Re-exports§
Modules§
- errors
- Errors that can be generated by the crate
- generators
- Implements various algorithms for generating new schedules.
- modifiers
- Contains various modifiers and filters that can be applied to generators.
- Implements Probability Distribution Functions
- point_
spread - Implements the Point Spread Function
- reconstruction
- Algorithms for reconstructing NMR signals.
- terminal_
viz terminal-viz - Plotting and visualization in the terminal. Requires the
terminal-vizfeature to be enabled.
Macros§
- modifier
- Creates boilerplate (including a builder extension trait) for modifiers
Structs§
- Schedule
- Represents a sampling schedule. Schedules are represented as a list of booleans, where
truemeans to take the sample at the position of the index andfalsemeans to not take the sample.
Enums§
- Display
Mode - Represents whether a spectrum is meant to be displayed as the real part or as the absolute value
- Encoding
Type - When saving or loading a schedule, would the first sample be represented by zero or one?
Traits§
- Complex
Sequence - An extension trait adding utility functions to lists of complex numbers.