Down-sample image using local maximum


I was wondering if there are (imglib2) methods for downsampling (binning) a 3D image using the local maximum as the value of the new pixel.

Specifically, I would like to do a 3x3x3 binning where the resulting voxel is the maximum value of each 3x3x3 neighborhood.

I don’t think this is possible yet. You’d have to implement a MaxIntensityInterpolatorFactory for this.

The interpolation methods available in ImgLib2 are defined by the classes implementing InterpolatorFactory:

  • FloorInterpolatorFactory
  • InverseDistanceWeightingInterpolatorFactory
  • LanczosInterpolatorFactory
  • NearestNeighborInterpolatorFactory
  • NearestNeighborSearchInterpolatorFactory
  • NLinearInterpolatorARGBFactory
  • NLinearInterpolatorFactory

Also have a look at the Interpolation section in the ImgLib2 Examples:

1 Like

Thanks for the answer.

In fact, I was just by chance now stumbling about the command

[Image > Transform > Bin…]

This implements “Max” as an option; at first I did not find it, because I only knew about the command:

[Image > Scale …]

, which does not have the “Max” option.

1 Like