Skip to main content

calculate_weights_romeo_with_flags

Function calculate_weights_romeo_with_flags 

Source
pub fn calculate_weights_romeo_with_flags(
    phase: &[f64],
    mag: &[f64],
    phase2: Option<&[f64]>,
    te1: f64,
    te2: f64,
    mask: &[u8],
    nx: usize,
    ny: usize,
    nz: usize,
    flags: [bool; 6],
) -> Vec<u8> 
Expand description

Calculate ROMEO edge weights with full 6-component flag control.

Matches ROMEO.jl calculateweights_romeo. The 6 flags are: 0: phase coherence, 1: phase gradient coherence, 2: phase linearity, 3: magnitude coherence, 4: magnitude weight, 5: magnitude weight 2.

Each component is scaled as 0.1 + 0.9 * value (matching ROMEO.jl) to prevent any single component from zeroing the weight entirely.

Weights are stored as u8: 0 = no edge, 1 = worst valid, 255 = best.