pub struct JointReconstruction<A> {
pub object_algorithm: A,
pub optics: Optics,
pub initial_illumination: Illumination,
pub illumination_calibration: IlluminationCalibration,
pub outer_iterations: usize,
pub object_iterations_per_outer: usize,
pub illumination_steps_per_outer: usize,
}Expand description
Alternates an existing object or object/pupil algorithm with physical LED calibration.
One runner iteration is one outer iteration. The complete acquisition order is supplied
to the wrapped algorithm object_iterations_per_outer times, then bounded physical
updates refresh only illumination-dependent model state. Generic Fourier-grid correction
remains an independent feature of crate::algorithms::GradientDescent.
The joint-estimation motivation follows J. Sun, Q. Chen, Y. Zhang, and C. Zuo, “Efficient positional misalignment correction method for Fourier ptychographic microscopy,” Biomedical Optics Express 7(4), 1336–1350 (2016). This implementation uses bounded, scaled finite differences rather than that work’s simulated annealing and nonlinear regression. It does not implement the brightfield circle detection or spectral correlation of R. Eckert, Z. F. Phillips, and L. Waller, “Efficient illumination angle self-calibration in Fourier ptychography,” Applied Optics 57(19), 5434–5442 (2018).
Fields§
§object_algorithm: AExisting analytic object or object/pupil update algorithm.
optics: OpticsOptical configuration used to resolve physical source positions.
initial_illumination: IlluminationNominal reusable physical illumination.
illumination_calibration: IlluminationCalibrationPhysical parameter selection, priors, loss, and bounded optimizer.
outer_iterations: usizeNumber of alternating outer iterations.
object_iterations_per_outer: usizeComplete object-update passes before each physical phase.
illumination_steps_per_outer: usizeRepetitions of the configured bounded physical phase per outer iteration.
Implementations§
Source§impl<A> JointReconstruction<A>
impl<A> JointReconstruction<A>
Sourcepub fn new(
object_algorithm: A,
optics: Optics,
initial_illumination: Illumination,
illumination_calibration: IlluminationCalibration,
outer_iterations: usize,
) -> Self
pub fn new( object_algorithm: A, optics: Optics, initial_illumination: Illumination, illumination_calibration: IlluminationCalibration, outer_iterations: usize, ) -> Self
Creates an alternating reconstruction with one object pass and one calibration phase.
Sourcepub fn object_iterations_per_outer(self, iterations: usize) -> Self
pub fn object_iterations_per_outer(self, iterations: usize) -> Self
Sets the positive number of complete object passes in each outer iteration.
Sourcepub fn illumination_steps_per_outer(self, steps: usize) -> Self
pub fn illumination_steps_per_outer(self, steps: usize) -> Self
Sets the positive number of bounded illumination phases in each outer iteration.
Source§impl<A: ReconstructionAlgorithm> JointReconstruction<A>
impl<A: ReconstructionAlgorithm> JointReconstruction<A>
Sourcepub fn run<M: MeasurementRead>(
self,
problem: &ReconstructionProblem<M>,
) -> Result<JointReconstructionResult>
pub fn run<M: MeasurementRead>( self, problem: &ReconstructionProblem<M>, ) -> Result<JointReconstructionResult>
Runs alternating reconstruction without callbacks and returns structured physical output.
Sourcepub fn run_with_callbacks<M: MeasurementRead>(
self,
problem: &ReconstructionProblem<M>,
callbacks: Vec<Box<dyn Callback>>,
) -> Result<JointReconstructionResult>
pub fn run_with_callbacks<M: MeasurementRead>( self, problem: &ReconstructionProblem<M>, callbacks: Vec<Box<dyn Callback>>, ) -> Result<JointReconstructionResult>
Runs alternating reconstruction with ordinary runner callbacks.
Outer-iteration callbacks receive physical phase metrics in the
physical_illumination namespace, and checkpoint callbacks capture the complete
physical state and refreshed model.
Sourcepub fn run_from_checkpoint<M: MeasurementRead>(
self,
problem: &ReconstructionProblem<M>,
checkpoint: ReconstructionCheckpoint,
) -> Result<JointReconstructionResult>
pub fn run_from_checkpoint<M: MeasurementRead>( self, problem: &ReconstructionProblem<M>, checkpoint: ReconstructionCheckpoint, ) -> Result<JointReconstructionResult>
Resumes alternating reconstruction from a checkpoint containing physical state.
Trait Implementations§
Source§impl<A: Clone> Clone for JointReconstruction<A>
impl<A: Clone> Clone for JointReconstruction<A>
Source§fn clone(&self) -> JointReconstruction<A>
fn clone(&self) -> JointReconstruction<A>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<A: Debug> Debug for JointReconstruction<A>
impl<A: Debug> Debug for JointReconstruction<A>
Source§impl<A: ReconstructionAlgorithm> ReconstructionAlgorithm for JointReconstruction<A>
impl<A: ReconstructionAlgorithm> ReconstructionAlgorithm for JointReconstruction<A>
Source§type IterationMetrics = JointIterationMetrics
type IterationMetrics = JointIterationMetrics
Source§fn validate(&self) -> Result<()>
fn validate(&self) -> Result<()>
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 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 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 iterations(&self) -> usize
fn iterations(&self) -> usize
Source§fn batch_size(&self) -> usize
fn batch_size(&self) -> usize
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<A> Freeze for JointReconstruction<A>where
A: Freeze,
impl<A> RefUnwindSafe for JointReconstruction<A>where
A: RefUnwindSafe,
impl<A> Send for JointReconstruction<A>where
A: Send,
impl<A> Sync for JointReconstruction<A>where
A: Sync,
impl<A> Unpin for JointReconstruction<A>where
A: Unpin,
impl<A> UnsafeUnpin for JointReconstruction<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for JointReconstruction<A>where
A: UnwindSafe,
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