pub struct InversionConfig {Show 23 fields
pub algorithm: InversionAlgorithm,
pub tkd: TkdParams,
pub tsvd: TkdParams,
pub tikhonov: TikhonovParams,
pub tv: TvParams,
pub rts: RtsParams,
pub nltv: NltvParams,
pub medi: MediParams,
pub tfi: TfiParams,
pub ilsqr: IlsqrParams,
pub star: StarParams,
pub tgv: TgvParams,
pub qsmart: QsmartParams,
pub ndi: NdiParams,
pub fansi: FansiParams,
pub l1qsm: L1QsmParams,
pub whqsm: WhQsmParams,
pub hdqsm: HdQsmParams,
pub amp_pe: AmpPeParams,
pub lsqr: LsqrQsmParams,
pub apply_heidi: bool,
pub heidi: HeidiParams,
pub tile: Option<(usize, usize)>,
}Expand description
Dipole inversion configuration
Fields§
§algorithm: InversionAlgorithm§tkd: TkdParams§tsvd: TkdParams§tikhonov: TikhonovParams§tv: TvParams§rts: RtsParams§nltv: NltvParams§medi: MediParams§tfi: TfiParams§ilsqr: IlsqrParams§star: StarParamsSTAR-QSM (te and b0 are overridden from scan metadata by the dispatcher).
tgv: TgvParams§qsmart: QsmartParams§ndi: NdiParams§fansi: FansiParamsShared by the Fansi (nlTV) and FansiTgv (nlTGV) algorithms; the
dispatcher sets is_tgv from the selected algorithm.
l1qsm: L1QsmParams§whqsm: WhQsmParams§hdqsm: HdQsmParams§amp_pe: AmpPeParamsAMP-PE (b0 is overridden from scan metadata by the dispatcher).
lsqr: LsqrQsmParamsMinimally regularised LSQR (b0 is overridden from scan metadata by the
dispatcher). Also HEIDI’s reference seed.
apply_heidi: boolHEIDI (Schweser 2012) as streaking reduction after the inversion: its cone fill
(crate::inversion::heidi_cone_fill) keeps the well-conditioned k-space of the method’s
χ and refills the dipole cone under a field-derived weighted-TV prior. With
InversionAlgorithm::Lsqr this is HEIDI as published, run as the authors’ pipeline runs
it (crate::inversion::heidi(): the unmasked LSQR seed on LSQR’s grid). Other seeds:
see the HEIDI module docs (Any seed), the heidi.* rules and heidi_seed_problem.
heidi: HeidiParamsHEIDI’s parameters, used with Self::apply_heidi.
tile: Option<(usize, usize)>Overlap-tiling for the deep-learning inversions, as (core, halo) in voxels. None
(default) runs the net whole-volume; Some runs it patch-by-patch (bounded memory) via the
*_tiled variants — an approximation, mainly for memory-constrained targets (e.g. WASM).
Stored as a plain tuple so this config type stays available without the onnx feature;
the dispatcher converts it to a crate::inversion::TileConfig. Ignored by the
natively-patch-based nets (autoqsm/qsmgan) and by non-DL algorithms.
Implementations§
Source§impl InversionConfig
impl InversionConfig
Sourcepub fn input(&self, n_echoes: usize) -> InversionInput
pub fn input(&self, n_echoes: usize) -> InversionInput
What the selected inversion reconstructs from, for data with n_echoes echoes. See
InversionInput.
It is a property of the config rather than of InversionAlgorithm alone, because
TGV depends on more than its name:
- TGV (
run_tgv) reconstructs multi-echo data from the field-mapped total field (TgvInput::FieldPpm, expressed as phase at the first echo time) and a single echo from its wrapped phase (TgvInput::WrappedPhase). Either way it does its own background removal.
The other total-field methods are TFI (a total-field method by definition: it inverts
the field over the whole FOV under a preconditioner), QSMART
(run_qsmart, whose two SDF stages are its background removal),
AutoQSM and NeXtQSM (networks with their own background removal). iQSM and iQSM+
(run_iqsm, run_iqsm_plus) take wrapped
phase. Every other method, including WH-QSM (which models only a residual harmonic
field) and LSQR (a residual-field term), takes the local field.
MEDI takes the local field with every option: plain MEDI, MEDI-SMV
(MediParams::smv) and MEDI-mSMV (MediParams::msmv). That is how the MEDI authors
run it. MEDI toolbox README.m runs RDF = PDF(iFreq, N_std, Mask, ...) and then
MEDI_L1('lambda',1000,'lambda_CSF',100,'merit','smv',5) on RDF, which its naming
convention defines as the local field. MEDI_L1 reads iFreq but never uses it. The
mSMV paper (Roberts et al. 2024, Eqs. 4 and 13) defines MEDI-SMV as the SMV high-pass of
the local field after PDF, and SEPIA passes MEDI its local field. The SMV step removes
the residual background that a background removal leaves near the brain edge. It is not
a background removal itself. On the total field, MEDI-SMV is a different pipeline. With
the default mask shrinking it gives nearly the same χ, but without shrinking it fails
(see the MEDI module docs). The authors’ pipeline uses PDF for the background removal
(reference_bg_removal).
Sourcepub fn cone_fill_after(&self) -> bool
pub fn cone_fill_after(&self) -> bool
Whether HEIDI’s cone fill runs on the method’s result after the inversion, rather than
inside it: Self::apply_heidi with any seed but LSQR, whose reference recipe
(crate::inversion::heidi()) run_dipole_inversion runs as
one step. run_dipole_inversion applies it either way. A
host that combines several inversions (two-pass) instead runs them with apply_heidi off
and fills the combined map once with run_heidi_cone_fill,
whatever the seed (an LSQR map is then filled as the method’s masked result, as
Wrapper_QSM_HEIDI4all fills any seed).
Sourcepub fn reference_bg_removal(&self) -> Option<BgRemovalAlgorithm>
pub fn reference_bg_removal(&self) -> Option<BgRemovalAlgorithm>
The background removal the selected method’s authors run in front of it, for a
InversionInput::LocalField method whose authors’ pipeline QSM.rs ports. Hosts can use
it as the default background removal for that method.
- MEDI (with or without SMV or mSMV):
BgRemovalAlgorithm::Pdf. The MEDI toolbox’sREADME.mrunsPDF.m(ported asBgRemovalAlgorithm::Pdf, with the sameFit_ppm_complexnoise weighting) and givesMEDI_L1its result. The mSMV paper (Roberts et al. 2024) also runs MEDI-SMV and MEDI-mSMV after PDF.
None when no such pipeline is recorded for the method. It is then the host’s choice.
Trait Implementations§
Source§impl Clone for InversionConfig
impl Clone for InversionConfig
Source§fn clone(&self) -> InversionConfig
fn clone(&self) -> InversionConfig
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 InversionConfig
impl Debug for InversionConfig
Auto Trait Implementations§
impl Freeze for InversionConfig
impl RefUnwindSafe for InversionConfig
impl Send for InversionConfig
impl Sync for InversionConfig
impl Unpin for InversionConfig
impl UnsafeUnpin for InversionConfig
impl UnwindSafe for InversionConfig
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