Expand description
Image-plane Fourier ptychographic microscopy (FPM) reconstruction and simulation.
The crate separates experimental geometry from numerical reconstruction. A typical workflow is:
- describe the microscope with
experiment::Opticsand an illumination source such asexperiment::PlanarLedArray, plus calibration and acquisition; - compile that description into an algorithm-facing
model::ImagePlaneModel; - pair the model with resident or lazy
measurementsin areconstruction::ReconstructionProblem; - select an
algorithmsimplementation and run it directly or through areconstruction::Runner; - inspect the complex object, amplitude, phase, pupil, trace, and
diagnosticsin the resultingreconstruction::ReconstructionResult; and - optionally create controlled data with
simulation, calculatemetrics, or persist result and benchmark bundles throughreconstruction::ResultBundleandbenchmark.
Experimental coordinates and detector arrays use explicit conventions documented on
their types. Two-dimensional arrays are generally indexed (row, column) and shaped
(height, width); transverse wave vectors are (kx, ky) in radians per metre.
§Example
use fpm_rs::{
algorithms::{AlternatingProjection, ReconstructionAlgorithm},
experiment::{ArrayPose, Illumination, Optics, PlanarLedArray},
measurements::{FrameMetadata, MeasurementStack},
model::{ImagePlaneModel, ReconstructionShape},
reconstruction::ReconstructionProblem,
};
use ndarray::Array3;
let optics = Optics {
wavelength_vacuum_m: 532e-9,
objective_na: 0.1,
magnification: 4.0,
camera_pixel_size: 6.5e-6,
illumination_refractive_index: 1.0,
objective_medium_refractive_index: 1.0,
defocus_distance: None,
pupil_aberration: None,
};
let illumination = Illumination::from_geometry(PlanarLedArray::new(
(1, 1),
(4e-3, 4e-3),
(0.0, 0.0),
ArrayPose::from_translation([0.0, 0.0, -90e-3]),
))?;
let model = ImagePlaneModel::from_experiment(
&optics,
&illumination,
(4, 4),
ReconstructionShape::Exact((4, 4)),
)?;
let measurements = MeasurementStack::new(
Array3::from_elem((1, 4, 4), 1.0),
vec![FrameMetadata::new(0)],
)?;
let problem = ReconstructionProblem::new(measurements, model)?;
let result = AlternatingProjection::default().iterations(1).run(&problem)?;
assert_eq!(result.object.dim(), (4, 4));Re-exports§
pub use benchmark_bundle::BenchmarkBundle;pub use benchmark_bundle::read_benchmark_bundle;pub use error::Error;pub use error::Result;pub use reconstruction::ResultBundle;pub use reconstruction::read_bundle;
Modules§
- algorithms
- Reconstruction algorithms and their shared execution contract. Iterative reconstruction algorithms for compiled image-plane models.
- backend
- CPU execution and the interfaces used by future resident-buffer backends. Execution backends and resident-buffer abstractions.
- benchmark
- Reproducible single-case reconstruction benchmarks.
- benchmark_
bundle - Normalized benchmark comparison bundles.
- callbacks
- Iteration callbacks for progress, checkpoints, diagnostics, and image output. Hooks that observe or control iterative reconstruction.
- complex
- Utilities for complex fields, amplitude, and wrapped phase. Allocation-aware helpers for two-dimensional complex sample fields.
- configuration
- Versioned experiment and simulation configuration.
- datasets
- Loading, discovery, caching, and subsetting for converted dataset bundles.
- diagnostics
- Structured iteration and per-frame reconstruction diagnostics. Structured convergence, coverage, and per-frame reconstruction diagnostics.
- error
- Error categories and the crate-wide
error::Resultalias. Error categories returned by validation, numerical, I/O, and bundle operations. - evaluation
- Composed evaluation of a reconstruction against reference data.
- experiment
- Physical optics and illumination geometry compiled into numerical models. Physical optics and illumination descriptions for an image-plane experiment.
- illumination_
calibration - Bounded physical planar-array calibration configuration, state, and diagnostics. Bounded physical calibration of planar LED-array illumination.
- illumination_
initialization - Bright-field circle initialization for bounded physical planar arrays. Bright-field circle initialization for physical planar LED arrays.
- measurements
- Resident and lazy low-resolution intensity measurement stacks. Low-resolution measured-intensity stacks and acquisition metadata.
- metrics
- Reusable numerical metrics, organized by the meaning of their inputs.
- model
- Compiled image-plane models, Fourier crops, pupils, and forward propagation. Compiled image-plane forward model used by simulation and reconstruction.
- reconstruction
- Reconstruction problems, state, schedules, runners, results, and checkpoints. Reconstruction inputs, execution state, schedules, checkpoints, and results.
- simulation
- Synthetic objects, camera response, acquisition effects, and simulation. Controlled synthetic acquisition for image-plane Fourier ptychography.
- tabular
- On-demand Polars conversions for reconstruction and benchmark records.
Type Aliases§
- Complex64
- Alias for a
Complex<f64>