pub struct RobustFitParams {
pub loss: RobustLoss,
pub tuning: Option<f64>,
pub iterations: usize,
pub downweight_level: f64,
pub flag_ratio: f64,
pub estimate_offset: bool,
}Expand description
Parameters for multi_echo_robust_fit.
Fields§
§loss: RobustLossWhich robust loss turns a residual into a weight.
tuning: Option<f64>Tuning constant, in units of the robust scale; smaller is more aggressive.
None uses RobustLoss::conventional_tuning for whichever loss is selected, which is
what you want unless you have measured otherwise. It is Option rather than a number
because the two losses’ natural constants differ by about 3.5x: a fixed default would
silently mean something quite different after changing Self::loss.
iterations: usizeIRLS reweighting passes. Three is plenty: the weights are a bounded function of a residual that is already close after the first pass, and more iterations mostly re-confirm the same decision.
0 is allowed and means report only: every robust weight stays at 1, so the field map
is exactly multi_echo_linear_fit’s, and EchoQuality (including
EchoQuality::flagged, which reads the final fit’s residuals) is still computed.
downweight_level: f64Robust weight below which an echo counts as downweighted at a voxel, for
EchoQuality::downweighted_fraction. Purely a reporting threshold — it changes no
weight and no fit.
flag_ratio: f64How far the worst EchoQuality::outlier_score in the series has to sit above the best
before EchoQuality::flagged names anything. Reporting only; nothing is dropped.
Relative, not absolute, because an absolute residual has no fixed meaning across field
strengths, echo trains and SNR. Measured on the four-echo 7 T phantom, where the ratio is
max(outlier_score) / min(outlier_score):
| series | ratio | flagged at 3.0 |
|---|---|---|
| clean | 2.5 | no |
| one echo, 35% slab dropout + phase scramble | 40.1 | yes |
| one echo, +1 rad everywhere | 28.2 | yes |
| one echo, +2.5 rad everywhere | 35.6 | yes |
| one echo, 12% slab dropout | 9.8 | yes |
3.0 sits in the gap between the clean series and the smallest true positive.
estimate_offset: boolEstimate and remove a constant phase offset, as in multi_echo_linear_fit. Costs one
degree of freedom, which matters here — see multi_echo_robust_fit.
Implementations§
Source§impl RobustFitParams
impl RobustFitParams
Sourcepub fn min_echoes(&self) -> usize
pub fn min_echoes(&self) -> usize
Fewest echoes multi_echo_robust_fit can act on: the model’s parameter count plus two,
so 4 with Self::estimate_offset and 3 without. Below this it has no residual degrees
of freedom to judge an echo with and returns the plain fit.
Trait Implementations§
Source§impl Clone for RobustFitParams
impl Clone for RobustFitParams
Source§fn clone(&self) -> RobustFitParams
fn clone(&self) -> RobustFitParams
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 RobustFitParams
impl Debug for RobustFitParams
Source§impl Default for RobustFitParams
impl Default for RobustFitParams
Source§impl PartialEq for RobustFitParams
impl PartialEq for RobustFitParams
Source§impl Serialize for RobustFitParams
impl Serialize for RobustFitParams
impl StructuralPartialEq for RobustFitParams
Auto Trait Implementations§
impl Freeze for RobustFitParams
impl RefUnwindSafe for RobustFitParams
impl Send for RobustFitParams
impl Sync for RobustFitParams
impl Unpin for RobustFitParams
impl UnsafeUnpin for RobustFitParams
impl UnwindSafe for RobustFitParams
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