pub struct IlsqrParams {
pub tol: f64,
pub max_iter: usize,
pub pad_mm: f64,
pub precision: IlsqrPrecision,
}Expand description
Parameters for the iLSQR algorithm.
The iteration cap defaults to QSM_iLSQR’s own default, 100, which is what runs when it is
called as a function without 'niter': UK Biobank’s pipeline and STI Suite’s own
STI_Templates.m example call it that way (decided 2026-10-29; until then the default was
the GUI’s 40, which remains available as max_iter: STI_GUI_NITER). The padding defaults
to what STI Suite 3.0’s QSM_GUI passes (as for STAR-QSM’s padding,
crate::inversion::StarParams::pad). Probed in MATLAB R2023b by driving QSM_GUI headless (“3D GRE data”, then “iLSQR”) with a
logging wrapper around QSM_iLSQR: the GUI passes a params struct with niter 40,
padsize [12 12 12], tol_step1 0.01, tol_step2 0.001 and Kthreshold 0.1, bitwise
equal to QSM_iLSQR(..., 'padsize', [12 12 12], 'niter', 40). Called without them,
QSM_iLSQR uses niter 100 and padsize 6. The initial LSQR solve always uses STI’s
tolerance of 0.01. max_iter is STI’s 'niter' argument (it caps both solves).
pad_mm is STI’s 'padsize' (see the module docs, Padding).
Measured, the GUI’s settings (40, 12 mm) against the function’s defaults (100, 6 mm): on the qsm-forward phantom’s true local field χ XSIM 0.686 → 0.671, NRMSE 40.3 → 42.0 %, r 0.916 → 0.908 (the fewer iterations; 12 mm alone changes little), at under half the run time; behind the pipeline’s V-SHARP the differences are ≤ 0.01 XSIM (phantom 0.308 → 0.301). On an in-vivo 3T scan behind the default V-SHARP, agreement with the UK Biobank pipeline’s χ is XSIM 0.772 → 0.764, NRMSE 75.5 → 73.5 %, r 0.814 → 0.820.
Fields§
§tol: f64Tolerance of the streaking-artefact solve (default: 1e-3)
max_iter: usizeMaximum iterations of each LSQR solve: STI’s 'niter' (default STI_DEFAULT_NITER =
100, QSM_iLSQR’s own default, which UK Biobank, STI_Templates.m and the χ-separation
toolbox’s Chisep_script.m leave in place; QSM_GUI passes STI_GUI_NITER = 40, and
QSMART 50)
pad_mm: f64Zero padding per side in mm, on every axis: STI’s 'padsize' (default
STI_GUI_PAD_MM = 12, what QSM_GUI passes; STI_DEFAULT_PAD_MM = 6 is
QSM_iLSQR’s own default and STI_PAD_MM reproduces UK Biobank / STI Suite’s
examples). Must be finite and ≥ 0.
precision: IlsqrPrecisionArithmetic of the two LSQR solves (default IlsqrPrecision::Double; Single is
STI Suite’s own, for parity with it)
Implementations§
Trait Implementations§
Source§impl Clone for IlsqrParams
impl Clone for IlsqrParams
Source§fn clone(&self) -> IlsqrParams
fn clone(&self) -> IlsqrParams
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 IlsqrParams
impl Debug for IlsqrParams
Source§impl Default for IlsqrParams
impl Default for IlsqrParams
Auto Trait Implementations§
impl Freeze for IlsqrParams
impl RefUnwindSafe for IlsqrParams
impl Send for IlsqrParams
impl Sync for IlsqrParams
impl Unpin for IlsqrParams
impl UnsafeUnpin for IlsqrParams
impl UnwindSafe for IlsqrParams
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
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for 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