neutompy.image.rebin

neutompy.image.rebin.rebin(arr, binsize, dtype=<class 'numpy.float32'>)[source]

This function rebins a single 2D image or 3D stack. It reduces the size of an image or stack of images by binning groups of pixels of user-specified sizes. The resulting pixels are computed as average.

Parameters:
  • arr (ndarray, 2d or 3d) – The 2D image or the 3D stack of images to rebin.

  • binsize (tuple) – Tuple defining the bin size for each axis of the array. E.g.: for 2d array (bin_0, bin_1)

    for 3d array (bin_0, bin_1, bin_2)

  • dtype (type, optional) – The type of the returned rebbined array.

Returns:

m (ndarray) – The rebinned image or stack of images.