Skip to main content

average_roi

Function average_roi 

Source
pub fn average_roi(
    data: &Array3<f64>,
    y_range: Range<usize>,
    x_range: Range<usize>,
) -> Result<Array1<f64>, IoError>
Expand description

Average spectra over a rectangular region of interest.

§Arguments

  • data — 3D array with shape (n_tof, height, width).
  • y_range — Row range (start..end).
  • x_range — Column range (start..end).

§Errors

Returns IoError::InvalidParameter if the ROI is empty or exceeds the spatial dimensions of data.

§Returns

Averaged 1D spectrum of length n_tof.