Skip to main content

bfrnet

Function bfrnet 

Source
pub fn bfrnet(
    field_ppm: &[f64],
    mask: &[u8],
    grid: &Grid,
    model_onnx: &[u8],
) -> Result<Vec<f64>, OnnxError>
Expand description

Run BFRnet on a total field map.

  • field_ppm — total field (ppm), column-major (nx,ny,nz).
  • mask — binary brain mask (same layout).
  • model_onnx — bytes of the exported bfrnet.onnx.

Returns the local tissue field (ppm), masked, in the same layout.

The whole volume is run in one pass. BFRnet is fully convolutional with three pooling levels, so each spatial dimension is zero-padded up to a multiple of 8 and cropped back. (Memory-bounded Hann-blended tiling — as the Python port uses for very large volumes — is a future refinement.)