pub fn bfrnet_tiled(
field_ppm: &[f64],
mask: &[u8],
grid: &Grid,
model_onnx: &[u8],
cfg: &TileConfig,
progress: impl FnMut(usize, usize),
) -> Result<Vec<f64>, OnnxError>Expand description
BFRnet patch by patch: each core block of the background field is predicted from a patch
with halo voxels of context on every side (zero outside the volume), padded to a multiple of
8, so peak memory follows the patch, not the volume.
An approximation of bfrnet: each patch sees only its own part of the masked field, while
the background field it predicts comes from sources outside the brain. Tiles that do not touch
mask are skipped. Returns the local field (ppm), masked, like bfrnet.