Skip to main content

run_windows

Function run_windows 

Source
fn run_windows<T: Posterior>(
    model: &OnnxModel,
    data: &[f32],
    dims: [usize; 3],
    n_labels: usize,
    patch: usize,
    overlap: usize,
    flip: Option<&[usize]>,
    progress: &mut impl FnMut(usize, usize),
) -> Result<Vec<T>, OnnxError>
Expand description

Sliding-window posteriors (channels-last, [d0, d1, d2, n_labels]) of the network input data (dims multiples of LATTICE): the network on each patch-cube window (clamped to the volume on an axis it does not exceed), origins on the pooling lattice (lattice_windows), blended with nnU-Net’s Gaussian importance. With flip (the label table’s left-right partners), each window is also run mirrored along axis 0 and its posteriors, mirrored back with each channel mapped to its partner, averaged in, as the whole-volume flip averaging does. The blur is the caller’s, once, on the blended posteriors.

The blending weights are summed before any window runs, so each window’s posteriors go straight into the normalised mean: the only whole-volume buffers are the posteriors (as T) and one weight per voxel.