pub struct TgvParams {
pub alpha1: f32,
pub alpha0: f32,
pub iterations: Option<usize>,
pub erosions: usize,
pub step_size: f32,
pub te: EchoTime,
pub reference_divergence: bool,
pub reference_edge_erosion: bool,
pub reference_output_box: bool,
}Expand description
TGV parameters. alpha0/alpha1 are in the reference’s rad units (see the module docs).
Fields§
§alpha1: f32First-order TGV weight (gradient term), rad units
alpha0: f32Second-order TGV weight (symmetric gradient term), rad units
iterations: Option<usize>Number of primal-dual iterations; None uses get_default_iterations for the
voxel size and step_size, as the reference does.
erosions: usizeNumber of mask erosions
step_size: f32Primal step size multiplier (larger = faster but less stable; 1 is the publication)
te: EchoTimeWhich echo time a field (TgvInput::FieldPpm) is converted to phase at; a wrapped
echo is at its own. Default EchoTime::First:
QuantitativeSusceptibilityMappingTGV.jl takes the phase of one echo and its TE
(qsm_tgv(phase, mask, res; TE, ...), README, af7650b) and has no rule for a field
combined over echoes, so the first echo time, the default where the reference does not
say.
reference_divergence: boolUse the reference’s divergence in the w update (default false: the exact adjoint of
the symmetric gradient). The reference scales each row of q by that row’s own
resolution; on anisotropic voxels that is not the adjoint, so Chambolle–Pock does not
solve the stated TGV problem. No effect on isotropic voxels. See the module docs,
Where QSM.rs differs from the reference.
reference_edge_erosion: boolErode the mask as the reference does (default false: erode it from the array’s edge
too). The reference skips neighbours outside the array, so a mask that reaches an array
face is not eroded from it, and keeps voxels whose Laplacian and gradient stencils have
no neighbour there. No effect unless the mask reaches an array face.
With this, reference_divergence and
reference_output_box, QSM.rs matches the package to
float32 rounding (tests/tgv_tgvjl_parity.rs).
reference_output_box: boolReturn χ over the reference’s whole working box (default false: inside the eroded
mask only, zero elsewhere). The reference returns every voxel of the eroded mask’s
bounding box plus one voxel (reduce_to_mask_box, src/tgv.jl L21, L86-88), so a rim
of up to two voxels just outside the eroded mask carries the stencils’ spill-over, where
the data term does not act. A comparison with the package inside an uneroded mask
counts that rim. See the module docs, Where QSM.rs differs from the reference.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TgvParams
impl RefUnwindSafe for TgvParams
impl Send for TgvParams
impl Sync for TgvParams
impl Unpin for TgvParams
impl UnsafeUnpin for TgvParams
impl UnwindSafe for TgvParams
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