Package org.micromanager.mmomezarr
Class Downsampler
- java.lang.Object
-
- org.micromanager.mmomezarr.Downsampler
-
public final class Downsampler extends Object
2×2 block-averaging downsampler used to build pyramid levels, adapting the averaging scheme ofNDTiffStorage.downsample. Produces an image of dimensionsceil(width/2) × ceil(height/2); odd edges average only the available pixels.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intdownHeight(int height)Downsampled height for a given source height.static Objectdownsample(Object pixels, int width, int height, PixelType type)Downsample a single plane by 2×2 averaging.static intdownWidth(int width)Downsampled width for a given source width.
-
-
-
Method Detail
-
downWidth
public static int downWidth(int width)
Downsampled width for a given source width.
-
downHeight
public static int downHeight(int height)
Downsampled height for a given source height.
-
downsample
public static Object downsample(Object pixels, int width, int height, PixelType type)
Downsample a single plane by 2×2 averaging.- Parameters:
pixels- row-major primitive array ofwidth*heightelementswidth- source widthheight- source heighttype- pixel type- Returns:
- a new primitive array of
downWidth(width)*downHeight(height)elements
-
-