pub struct AlternatingProjection {
pub iterations: usize,
pub object_step: f64,
pub batch_size: usize,
pub epsilon: f64,
pub loss_type: LossType,
}Expand description
Alternating-projection reconstruction for Fourier ptychographic microscopy.
§Method
For each measured frame, the algorithm extracts the corresponding patch of the current high-resolution object spectrum, multiplies it by the pupil, and propagates the resulting field to the detector plane. It replaces the predicted detector amplitude with the measured amplitude while retaining the predicted phase, propagates the corrected field back to Fourier space, and inserts the resulting correction into the object spectrum. Repeating this operation over overlapping Fourier patches makes them converge toward a mutually consistent complex object.
For incoherently multiplexed frames, one measured-to-predicted amplitude ratio is applied jointly to every source mode before their corrections are back-projected.
§Reference
G. Zheng, R. Horstmeyer, and C. Yang, “Wide-field, high-resolution Fourier ptychographic microscopy” (2013), Nature Photonics 7, 739–745.
Fields§
§iterations: usizeNumber of complete passes through the acquisition schedule.
object_step: f64Relaxation factor applied to each object-spectrum correction.
batch_size: usizeNumber of measured frames supplied to each reconstruction step.
epsilon: f64Positive numerical floor used in divisions and dark-field handling.
loss_type: LossTypeLoss used for diagnostics; the projection itself always enforces the measured amplitude.
Implementations§
Source§impl AlternatingProjection
impl AlternatingProjection
Sourcepub fn iterations(self, iterations: usize) -> Self
pub fn iterations(self, iterations: usize) -> Self
Sets the number of complete acquisition-schedule passes; validation requires non-zero.
Sourcepub fn object_step(self, object_step: f64) -> Self
pub fn object_step(self, object_step: f64) -> Self
Sets the finite positive relaxation applied to object-spectrum corrections.
Sourcepub fn batch_size(self, batch_size: usize) -> Self
pub fn batch_size(self, batch_size: usize) -> Self
Sets the positive number of acquisition frames supplied per step.
Trait Implementations§
Source§impl Clone for AlternatingProjection
impl Clone for AlternatingProjection
Source§fn clone(&self) -> AlternatingProjection
fn clone(&self) -> AlternatingProjection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AlternatingProjection
impl Debug for AlternatingProjection
Source§impl Default for AlternatingProjection
impl Default for AlternatingProjection
Source§impl ReconstructionAlgorithm for AlternatingProjection
impl ReconstructionAlgorithm for AlternatingProjection
Source§type IterationMetrics = NoIterationMetrics
type IterationMetrics = NoIterationMetrics
Source§fn validate(&self) -> Result<()>
fn validate(&self) -> Result<()>
Source§fn step<M: MeasurementRead>(
&mut self,
problem: &ReconstructionProblem<M>,
state: &mut ReconstructionState,
batch: &Batch,
_iteration: usize,
) -> Result<StepOutput<Self::IterationMetrics>>
fn step<M: MeasurementRead>( &mut self, problem: &ReconstructionProblem<M>, state: &mut ReconstructionState, batch: &Batch, _iteration: usize, ) -> Result<StepOutput<Self::IterationMetrics>>
state for one scheduled batch in zero-based iteration.Source§fn iterations(&self) -> usize
fn iterations(&self) -> usize
Source§fn batch_size(&self) -> usize
fn batch_size(&self) -> usize
Source§fn validate_problem<M: MeasurementRead>(
&self,
_problem: &ReconstructionProblem<M>,
) -> Result<()>
fn validate_problem<M: MeasurementRead>( &self, _problem: &ReconstructionProblem<M>, ) -> Result<()>
problem.Source§fn initialize<M: MeasurementRead>(
&self,
problem: &ReconstructionProblem<M>,
) -> Result<ReconstructionState>
fn initialize<M: MeasurementRead>( &self, problem: &ReconstructionProblem<M>, ) -> Result<ReconstructionState>
problem.Source§fn initialize_with_backend<M: MeasurementRead>(
&self,
problem: &ReconstructionProblem<M>,
backend: Arc<dyn Backend>,
) -> Result<ReconstructionState>
fn initialize_with_backend<M: MeasurementRead>( &self, problem: &ReconstructionProblem<M>, backend: Arc<dyn Backend>, ) -> Result<ReconstructionState>
backend.Source§fn canonicalize_state<M: MeasurementRead>(
&self,
_problem: &ReconstructionProblem<M>,
_state: &mut ReconstructionState,
) -> Result<()>
fn canonicalize_state<M: MeasurementRead>( &self, _problem: &ReconstructionProblem<M>, _state: &mut ReconstructionState, ) -> Result<()>
Source§fn supports_joint_reconstruction(&self) -> bool
fn supports_joint_reconstruction(&self) -> bool
Source§fn run<M: MeasurementRead>(
self,
problem: &ReconstructionProblem<M>,
) -> Result<ReconstructionResult>where
Self: Sized,
fn run<M: MeasurementRead>(
self,
problem: &ReconstructionProblem<M>,
) -> Result<ReconstructionResult>where
Self: Sized,
Source§fn run_with_callbacks<M: MeasurementRead>(
self,
problem: &ReconstructionProblem<M>,
callbacks: Vec<Box<dyn Callback>>,
) -> Result<ReconstructionResult>where
Self: Sized,
fn run_with_callbacks<M: MeasurementRead>(
self,
problem: &ReconstructionProblem<M>,
callbacks: Vec<Box<dyn Callback>>,
) -> Result<ReconstructionResult>where
Self: Sized,
callbacks at their declared hooks.Source§fn run_from_checkpoint<M: MeasurementRead>(
self,
problem: &ReconstructionProblem<M>,
checkpoint: ReconstructionCheckpoint,
) -> Result<ReconstructionResult>where
Self: Sized,
fn run_from_checkpoint<M: MeasurementRead>(
self,
problem: &ReconstructionProblem<M>,
checkpoint: ReconstructionCheckpoint,
) -> Result<ReconstructionResult>where
Self: Sized,
problem.Auto Trait Implementations§
impl Freeze for AlternatingProjection
impl RefUnwindSafe for AlternatingProjection
impl Send for AlternatingProjection
impl Sync for AlternatingProjection
impl Unpin for AlternatingProjection
impl UnsafeUnpin for AlternatingProjection
impl UnwindSafe for AlternatingProjection
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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