public final class ImgUtils extends Object
Modifier and Type | Field and Description |
---|---|
static List<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 ImgPlus<UnsignedByteType> |
argbToMultiChannel(ImgPlus<ARGBType> img)
Treat alpha, red, green, and blue values in
ARGBType image
as a separate, last channel dimension. |
static List<AxisType> |
axesOf(ImgPlus<?> img)
Extract axes from
ImgPlus . |
static List<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<AxisType> axes,
DatasetType type,
int[] chunkDims,
int[] blockDims)
Compute chunk and block dimensions suitable for writing.
|
static List<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<AxisType> |
toImagejAxes(String axes)
Convert string with chars from
DEFAULT_STRING_AXES
to axes from DEFAULT_AXES . |
static String |
toStringAxes(List<AxisType> axes)
Convert axes from
DEFAULT_AXES
to string with chars from DEFAULT_STRING_AXES . |
static <T extends Type<T>> |
transformDims(Img<T> img,
List<AxisType> srcAxes)
|
static <T extends Type<T>> |
transformDims(Img<T> img,
List<AxisType> srcAxes,
List<AxisType> dstAxes)
Change dimensions of the image with the given source axes to match destination axes.
|
public static final List<AxisType> DEFAULT_AXES
public static final String DEFAULT_STRING_AXES
DEFAULT_AXES
.public static String toStringAxes(List<AxisType> axes)
DEFAULT_AXES
to string with chars from DEFAULT_STRING_AXES
.public static List<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<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 <T extends Type<T>> Img<T> transformDims(Img<T> img, List<AxisType> srcAxes)
public static <T extends Type<T>> Img<T> transformDims(Img<T> img, List<AxisType> srcAxes, List<AxisType> dstAxes)
Existing axes are transposed to match the new order, new axes are inserted as singletons.
public static List<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 ImgPlus<UnsignedByteType> argbToMultiChannel(ImgPlus<ARGBType> img)
ARGBType
image
as a separate, last channel dimension.Copyright © 2020–2024 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.