Skip to main content

B0EstimationMethod

Enum B0EstimationMethod 

Source
pub enum B0EstimationMethod {
    WeightedAvg {
        weighting: B0WeightType,
    },
    LinearFit(LinearFitParams),
    RobustFit(RobustFitParams),
    ComplexFit(FitPpmComplexParams),
    QsmartEchofit {
        fit_threshold: QsmartFitThreshold,
    },
}
Expand description

How run_field_mapping combines the unwrapped echoes into one B0 map. Each method carries exactly the settings it reads, so a weighting cannot be set on a fit that ignores it.

Only multi-echo data is combined. A single echo is φ/TE whatever is chosen here, except that Self::RobustFit refuses a series too short for it (see RobustFitParams::min_echoes) and Self::ComplexFit needs the echo’s magnitude (it is also φ/TE there, as in MEDI).

Variants§

§

WeightedAvg

Weighted mean of the per-echo frequencies, B0 = Σ wₑ (φₑ/TEₑ) / Σ wₑ, with wₑ from weighting (default B0WeightType::PhaseSNR). The default method.

Fields

§weighting: B0WeightType

Per-echo weight; B0WeightType::AssumedDecay needs a finite, positive T2*.

§

LinearFit(LinearFitParams)

Magnitude-weighted least-squares fit of phase against TE (multi_echo_linear_fit). The weight is always the magnitude; there is no B0WeightType here.

§

RobustFit(RobustFitParams)

Motion-robust echo combination (multi_echo_robust_fit): the same magnitude-weighted fit as Self::LinearFit, iteratively reweighted so that an echo which departs from a straight line in TE at a voxel stops pulling the slope there. The weight is magnitude × robust weight; there is no B0WeightType, because the robust scale is measured on magnitude-standardised residuals and another weighting would break that.

Needs at least RobustFitParams::min_echoes echoes (4 with estimate_offset, else 3); fewer is PipelineError::InvalidConfig rather than a silent plain fit. The per-echo report is returned in FieldMappingResult::robust_fit.

§

ComplexFit(FitPpmComplexParams)

MEDI’s field map: the complex fit of Fit_ppm_complex.m (fit_ppm_complex) to the wrapped echoes, then spatial unwrapping of the fitted phase per echo spacing with unwrapping_algorithm, then division by the echo spacing. MEDI uses its region-growing unwrapPhase (UnwrappingAlgorithm::MediRegionGrowing); the rule complex-fit.unwrap-region-growing offers it as the authors’ setting, never preselected, and ROMEO (given MEDI’s iMag, the root-sum-of-squares of the echo magnitudes) stays the default.

This replaces the per-echo path rather than combining unwrapped echoes: the fit has its own phase offset (p0), so phase_offset_removal does not apply and is not run; bipolar_correction is refused (MEDI’s Fit_ppm_complex_bipolar is not ported). Needs the magnitude of every echo and evenly spaced echoes. Also returns the field’s noise map (FieldMappingResult::field_noise_ppm, MEDI’s N_std).

§

QsmartEchofit

QSMART’s echo fit (echofit.m, qsmart_echofit): the magnitude-weighted fit of phase against TE through the origin, over every voxel of the unwrapped echoes, with no per-echo constant removed after Laplacian unwrapping (with ROMEO, whole turns between echoes are aligned, as for the weighted mean). Also returns QSMART’s reliability map R_0 (FieldMappingResult::reliability): voxels whose fit residual, box-filtered over ~1 mm, reaches fit_threshold (by default the 99th percentile of the blurred residual, as QSMART’s authors run it; see QsmartFitThreshold). The field is converted to ppm with QSMART’s γ = 2.675e8 rad/s/T.

The echoes come from the configured unwrapping, phase-offset removal and bipolar correction. QSMART unwraps each echo with Laplacian unwrapping on the raw phase (unwrap_phase.m: LaplacianSolver::Mirror, FieldMappingConfig::laplacian_unmasked) and does neither of the others; with those settings this is QSMART’s field map, bit for bit. The rules qsmart.unwrap-laplacian, qsmart.laplacian-solver and qsmart.unwrap-unmasked suggest them for a QSMART run.

Fields

§fit_threshold: QsmartFitThreshold

Residual threshold for R_0

Implementations§

Source§

impl B0EstimationMethod

Source

pub fn id(&self) -> &'static str

Stable id of the method (its settings are not part of it).

Trait Implementations§

Source§

impl Clone for B0EstimationMethod

Source§

fn clone(&self) -> B0EstimationMethod

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for B0EstimationMethod

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for B0EstimationMethod

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for B0EstimationMethod

Source§

fn eq(&self, other: &B0EstimationMethod) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for B0EstimationMethod

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneAny for T
where T: Any + Clone,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

Converts 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)

Converts &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)

Converts &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
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.