public class ImageProcessorUtils extends Object
Modifier and Type | Method and Description |
---|---|
static ij.process.ImageProcessor |
createImageProcessor(Object pixels,
int width,
int height,
ColorModel colorModel)
Creates an
ImageProcessor . |
static Img<?> |
createImg(Object pixels,
int width,
int height)
Creates a two dimensional
Img that wraps around the array given as pixels. |
static boolean |
isSupported(Type<?> type)
Returns true if the given ImgLib2 pixel type is also supported by ImageJ1.
|
public static ij.process.ImageProcessor createImageProcessor(Object pixels, int width, int height, ColorModel colorModel)
ImageProcessor
.pixels
- The parameter must be an array: byte[], short[], int[] or float[].
The array length must equal width * height.
The array will be used by the ImageProcessor
to read and store the pixel values.width
- Width of the returned ImageProcessor
.height
- Height of the returned ImageProcessor
.colorModel
- ColorModel
used by the returned ImageProcessor
.ByteProcessor
, ShortProcessor
, ColorProcessor
or FloatProcessor
.
The concrete type is determined by the type of the array given as pixels.public static boolean isSupported(Type<?> type)
public static Img<?> createImg(Object pixels, int width, int height)
Img
that wraps around the array given as pixels.
Only supports UnsignedByteType, UnsignedShortType, FloatType and ARGBType.
This method is like createImageProcessor(Object, int, int, ColorModel)
but
creates an imglib2 Img
instead of an ImageProcessor
.Copyright © 2015–2022 ImgLib2. All rights reserved.