pub struct Simulator { /* private fields */ }Expand description
Builder for deterministic synthetic image-plane FPM acquisitions.
The simulator owns its true model and optional object, assumed reconstruction model,
camera, and illumination errors. Self::simulate consumes the builder and returns
all measurements and ground-truth artifacts.
Implementations§
Source§impl Simulator
impl Simulator
Sourcepub fn new(true_model: ImagePlaneModel) -> Self
pub fn new(true_model: ImagePlaneModel) -> Self
Creates a simulator whose input model describes the true experiment.
Use Self::reconstruction_model with a separately compiled assumed
optical model to simulate geometry or pupil mismatch.
Sourcepub fn ideal(model: ImagePlaneModel) -> Self
pub fn ideal(model: ImagePlaneModel) -> Self
Creates an ideal optical-intensity simulator without camera or acquisition errors.
Sourcepub fn object(self, object: SyntheticObject) -> Self
pub fn object(self, object: SyntheticObject) -> Self
Sets the owned high-resolution complex ground-truth object.
Sourcepub fn camera(self, camera: CameraModel) -> Self
pub fn camera(self, camera: CameraModel) -> Self
Adds a detector response and marks the acquisition non-ideal.
Sourcepub fn illumination_acquisition_errors(
self,
errors: IlluminationAcquisitionErrors,
) -> Self
pub fn illumination_acquisition_errors( self, errors: IlluminationAcquisitionErrors, ) -> Self
Adds non-geometric illumination acquisition errors.
Sourcepub fn reconstruction_model(self, model: ImagePlaneModel) -> Self
pub fn reconstruction_model(self, model: ImagePlaneModel) -> Self
Sets the optical model supplied to reconstruction after simulation.
For an optical mismatch, compile this model and the true model from
separate experiment descriptions. When a camera model is present,
Self::simulate compiles the known linear camera response into this
returned reconstruction model.
Sourcepub fn seed(self, seed: u64) -> Self
pub fn seed(self, seed: u64) -> Self
Sets the deterministic random seed used by acquisition and camera noise.
Sourcepub fn simulate(self) -> Result<SimulationResult>
pub fn simulate(self) -> Result<SimulationResult>
Simulates measurements and returns detector counts plus a count-space reconstruction model.
This differs from serialized crate::configuration::SimulationConfiguration,
which stores a strict optical reconstruction model and exposes
reconstruction_model_for_counts() for callers that load detector
counts later.
Auto Trait Implementations§
impl Freeze for Simulator
impl RefUnwindSafe for Simulator
impl Send for Simulator
impl Sync for Simulator
impl Unpin for Simulator
impl UnsafeUnpin for Simulator
impl UnwindSafe for Simulator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more