Skip to main content

Simulator

Struct Simulator 

Source
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

Source

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.

Source

pub fn ideal(model: ImagePlaneModel) -> Self

Creates an ideal optical-intensity simulator without camera or acquisition errors.

Source

pub fn object(self, object: SyntheticObject) -> Self

Sets the owned high-resolution complex ground-truth object.

Source

pub fn camera(self, camera: CameraModel) -> Self

Adds a detector response and marks the acquisition non-ideal.

Source

pub fn illumination_acquisition_errors( self, errors: IlluminationAcquisitionErrors, ) -> Self

Adds non-geometric illumination acquisition errors.

Source

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.

Source

pub fn seed(self, seed: u64) -> Self

Sets the deterministic random seed used by acquisition and camera noise.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,