pub enum IqsmEchoWeighting {
MagnitudeTeSquared,
MagnitudeSquaredTeSquared,
}Expand description
How the multi-echo iQSM and iQFM entry points combine their per-echo reconstructions:
Σ w·χ / Σ w over the echoes, voxel by voxel, with the weight w below. Without magnitudes
both are TE² (uniform magnitude), as in both of the authors’ implementations.
The authors’ two implementations disagree (checked at sunhongfu/iQSM 81f5462 and
sunhongfu/iQSM_Plus 3ba25f5):
- MATLAB (published with the paper):
sunhongfu/iQSMlegacy/matlab/demo_multi_echo.m:152-160andsunhongfu/iQSM_Pluslegacy/matlab/iQSM.m:260-267/iQFM.m:263-270multiply each echo’s output by its TE and fit that against TE withechofit.m(sunhongfu/iQSMlegacy/matlab/iQSM_fcns/echofit.m, zero intercept):Σ mag·TE·(TE·χ) / Σ mag·TE², i.e. weightsmag·TE². - Python (the current drivers):
sunhongfu/iQSMrun.py:170andapp.py:416weight by(mag·TE)², i.e. magnitude squared, although they print “Magnitude × TE²”. QSM-CI’s iQSM and iQFM originals (bb163ef) run this Python.
The default is MagnitudeSquaredTeSquared, (mag·TE)²
(Ashley’s decision, 2026-10-31). Each echo’s χ (or local field) estimate is its phase divided
by TE, and the phase noise has standard deviation ∝ 1/mag, so the estimate’s noise variance is
∝ 1/(mag·TE)²: (mag·TE)² is the inverse-variance weight, which gives the combination of least
variance. It is also the authors’ current Python, and iQSM+‘s weighting in both of its
authors’ implementations (sunhongfu/iQSM_Plus legacy/matlab/iQSM_plus.m:273-275,
run.py:199; see iqsm_plus_multi_echo, which has no choice). The MATLAB’s mag·TE²
(MagnitudeTeSquared) stays as an option, for parity with the
implementation published with the paper.
Variants§
MagnitudeTeSquared
w = mag·TE²: the authors’ MATLAB echo fit (an option, for parity with it).
MagnitudeSquaredTeSquared
w = (mag·TE)² = mag²·TE²: inverse-variance; the authors’ Python drivers (the default).
Implementations§
Trait Implementations§
Source§impl Clone for IqsmEchoWeighting
impl Clone for IqsmEchoWeighting
Source§fn clone(&self) -> IqsmEchoWeighting
fn clone(&self) -> IqsmEchoWeighting
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for IqsmEchoWeighting
Source§impl Debug for IqsmEchoWeighting
impl Debug for IqsmEchoWeighting
Source§impl Default for IqsmEchoWeighting
impl Default for IqsmEchoWeighting
Source§fn default() -> IqsmEchoWeighting
fn default() -> IqsmEchoWeighting
impl Eq for IqsmEchoWeighting
Source§impl PartialEq for IqsmEchoWeighting
impl PartialEq for IqsmEchoWeighting
impl StructuralPartialEq for IqsmEchoWeighting
Auto Trait Implementations§
impl Freeze for IqsmEchoWeighting
impl RefUnwindSafe for IqsmEchoWeighting
impl Send for IqsmEchoWeighting
impl Sync for IqsmEchoWeighting
impl Unpin for IqsmEchoWeighting
impl UnsafeUnpin for IqsmEchoWeighting
impl UnwindSafe for IqsmEchoWeighting
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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