public final class ImgUtils extends Object
Modifier and Type | Field and Description |
---|---|
static List<net.imagej.axis.AxisType> |
DEFAULT_AXES
Supported ImageJ axes in the default order.
|
static String |
DEFAULT_STRING_AXES
Supported axes in the character format, in the same order as
DEFAULT_AXES . |
Modifier and Type | Method and Description |
---|---|
static net.imagej.ImgPlus<net.imglib2.type.numeric.integer.UnsignedByteType> |
argbToMultiChannel(net.imagej.ImgPlus<net.imglib2.type.numeric.ARGBType> img)
Treat alpha, red, green, and blue values in
ARGBType image
as a separate, last channel dimension. |
static List<net.imagej.axis.AxisType> |
axesOf(net.imagej.ImgPlus<?> img)
Extract axes from
ImgPlus . |
static List<net.imagej.axis.AxisType> |
guessAxes(long[] dims)
Guess axes from image dimensions.
|
static int[] |
inputBlockDims(long[] dims,
int[] chunkDims)
Compute block dimensions suitable for reading.
|
static void |
outputDims(long[] dims,
List<net.imagej.axis.AxisType> axes,
DatasetType type,
int[] chunkDims,
int[] blockDims)
Compute chunk and block dimensions suitable for writing.
|
static List<net.imagej.axis.AxisType> |
parseJsonAxes(String json)
Parse axes from JSON string.
|
static int[] |
reversed(int[] a)
Return a new reversed array.
|
static long[] |
reversed(long[] a)
Return a new reversed array.
|
static String |
reversed(String s)
Return a reversed string.
|
static List<net.imagej.axis.AxisType> |
toImagejAxes(String axes)
Convert string with chars from
DEFAULT_STRING_AXES
to axes from DEFAULT_AXES . |
static String |
toStringAxes(List<net.imagej.axis.AxisType> axes)
Convert axes from
DEFAULT_AXES
to string with chars from DEFAULT_STRING_AXES . |
static <T extends net.imglib2.type.Type<T>> |
transformDims(net.imglib2.img.Img<T> img,
List<net.imagej.axis.AxisType> srcAxes)
|
static <T extends net.imglib2.type.Type<T>> |
transformDims(net.imglib2.img.Img<T> img,
List<net.imagej.axis.AxisType> srcAxes,
List<net.imagej.axis.AxisType> dstAxes)
Change dimensions of the image with the given source axes to match destination axes.
|
public static final List<net.imagej.axis.AxisType> DEFAULT_AXES
public static final String DEFAULT_STRING_AXES
DEFAULT_AXES
.public static String toStringAxes(List<net.imagej.axis.AxisType> axes)
DEFAULT_AXES
to string with chars from DEFAULT_STRING_AXES
.public static List<net.imagej.axis.AxisType> toImagejAxes(String axes)
DEFAULT_STRING_AXES
to axes from DEFAULT_AXES
.public static int[] reversed(int[] a)
public static long[] reversed(long[] a)
public static void outputDims(long[] dims, List<net.imagej.axis.AxisType> axes, DatasetType type, int[] chunkDims, int[] blockDims)
Chunk dimensions are used for HDF5 chunking. Block dimensions are used for tiling input dataset.
public static int[] inputBlockDims(long[] dims, int[] chunkDims)
public static List<net.imagej.axis.AxisType> axesOf(net.imagej.ImgPlus<?> img)
ImgPlus
.public static List<net.imagej.axis.AxisType> guessAxes(long[] dims)
public static <T extends net.imglib2.type.Type<T>> net.imglib2.img.Img<T> transformDims(net.imglib2.img.Img<T> img, List<net.imagej.axis.AxisType> srcAxes)
public static <T extends net.imglib2.type.Type<T>> net.imglib2.img.Img<T> transformDims(net.imglib2.img.Img<T> img, List<net.imagej.axis.AxisType> srcAxes, List<net.imagej.axis.AxisType> dstAxes)
Existing axes are transposed to match the new order, new axes are inserted as singletons.
public static List<net.imagej.axis.AxisType> parseJsonAxes(String json)
JSON string {"axes": [{"key": "y"}, {"key": "x}]}
produces axes XY
.
Note the reversed axis order.
org.json.JSONException
- if JSON is malformed/invalid, or if axes are invalid.public static net.imagej.ImgPlus<net.imglib2.type.numeric.integer.UnsignedByteType> argbToMultiChannel(net.imagej.ImgPlus<net.imglib2.type.numeric.ARGBType> img)
ARGBType
image
as a separate, last channel dimension.Copyright © 2020–2025 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.