pub struct IsmvParams {
pub variant: IsmvVariant,
pub tol: f64,
pub max_iter: Option<usize>,
pub radius: Option<f64>,
}Expand description
iSMV parameters. The defaults are Wen et al. 2014’s with the lab’s iSMV.m (see the
module docs); IsmvParams::qsmjl gives QSM.jl’s.
Fields§
§variant: IsmvVariantThe implementation to reproduce (default IsmvVariant::Wen2014).
tol: f64Stopping tolerance; finite and > 0. IsmvVariant::Wen2014: stop when the relative
change between successive iterates, ‖F₁ − F₂‖/‖F₁‖, falls below it (default 5e-5,
Wen et al. 2014; iSMV.m hard-codes 0.001). IsmvVariant::QsmJl: stop when the
residual falls to this fraction of the first one (QSM.jl’s tol, 1e-3).
max_iter: Option<usize>Iteration cap; None (the default) is none, as in iSMV.m. QSM.jl’s maxit is 500.
radius: Option<f64>Sphere radius in mm, finite and > 0; None (the default) is the variant’s default:
6 voxels for IsmvVariant::Wen2014 (Wen et al. 2014), 2 · max(voxel size) for
IsmvVariant::QsmJl. See IsmvParams::radius_mm. Before 2026-10-29 the default was
QSM.jl’s, and before 2026-10-28 5 mm with tol 1e-6 and 50 iterations, which had no
reference.
Implementations§
Source§impl IsmvParams
impl IsmvParams
Sourcepub const WEN2014_TOL: f64 = 5e-5
pub const WEN2014_TOL: f64 = 5e-5
Wen et al. 2014’s stopping tolerance on the relative change between iterates.
Sourcepub const WEN2014_RADIUS_VOXELS: f64 = 6.0
pub const WEN2014_RADIUS_VOXELS: f64 = 6.0
Wen et al. 2014’s radius in voxels (of the smallest voxel dimension).
Sourcepub const QSMJL_RADIUS_VOXELS: f64 = 2.0
pub const QSMJL_RADIUS_VOXELS: f64 = 2.0
QSM.jl ismv’s default kernel radius as a multiple of the largest voxel dimension.
Sourcepub fn qsmjl() -> Self
pub fn qsmjl() -> Self
QSM.jl ismv at its own defaults: IsmvVariant::QsmJl, tol 1e-3, maxit 500,
r = 2 · max(voxel size).
Sourcepub fn radius_mm(&self, grid: &Grid) -> f64
pub fn radius_mm(&self, grid: &Grid) -> f64
The sphere radius in mm on grid: radius, or the variant’s default
(6 · min(voxel size) for IsmvVariant::Wen2014, 2 · max(voxel size) for
IsmvVariant::QsmJl).
Sourcepub fn validate(&self) -> Result<(), InputError>
pub fn validate(&self) -> Result<(), InputError>
Checks what iSMV cannot run with: tol and the radius must be finite and > 0 (at
tol 0 and no cap the iteration would not end).
Trait Implementations§
Source§impl Clone for IsmvParams
impl Clone for IsmvParams
Source§fn clone(&self) -> IsmvParams
fn clone(&self) -> IsmvParams
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 IsmvParams
impl Debug for IsmvParams
Source§impl Default for IsmvParams
impl Default for IsmvParams
Auto Trait Implementations§
impl Freeze for IsmvParams
impl RefUnwindSafe for IsmvParams
impl Send for IsmvParams
impl Sync for IsmvParams
impl Unpin for IsmvParams
impl UnsafeUnpin for IsmvParams
impl UnwindSafe for IsmvParams
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