public class AxisUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AxisUtils.DefaultAxisTypes |
| Modifier and Type | Field and Description |
|---|---|
static String |
channelType |
static String |
cLabel |
static AxisUtils.DefaultAxisTypes |
defaultAxisTypes |
static String |
SPACE_UNIT |
static String |
spaceType |
static String |
TIME_UNIT |
static String |
timeType |
static String |
tLabel |
static String |
unknownType |
static String |
xLabel |
static String |
yLabel |
static String |
zLabel |
| Constructor and Description |
|---|
AxisUtils() |
| Modifier and Type | Method and Description |
|---|---|
static net.imglib2.realtransform.AffineGet |
axisPermutationTransform(int[] p) |
static Axis[] |
buildAxes(String... labels) |
static <T> boolean |
contains(T t,
T[] array)
Returns true if any elements of array equal t
|
static <T> boolean |
containsAny(Set<T> set,
T[] array)
Returns true if any elements of array are contained in the set
|
static Axis[] |
defaultAxes(int N) |
static Axis[] |
defaultAxes(String... labels) |
static Axis |
defaultAxis(String label) |
static String |
defaultLabel(int i) |
static DefaultAxisMetadata |
defaultN5ViewerAxes(N5SpatialDatasetMetadata meta)
The default axes for dialects that store only spatial data (n5viewer and
cosem), when time dimension is allowed.
|
static void |
fillPermutation(int[] p)
Replaces "-1"s in the input permutation array
with the largest value.
|
static <A extends AxisMetadata> |
findImagePlusPermutation(AxisMetadata axisMetadata)
Finds and returns a permutation p such that source[p[i]] equals target[i]
|
static int[] |
findImagePlusPermutation(String[] axisLabels)
Finds and returns a permutation p such that source[p[i]] equals xyczt
|
static int[] |
findImagePlusSpatialPermutation(int[] p) |
static <T> int[] |
findPermutation(T[] source,
T[] target)
Finds and returns a permutation p such that source[p[i]] equals target[i]
|
static String |
getDefaultType(String label) |
static String[] |
getDefaultTypes(String[] labels) |
static String |
getDefaultUnit(String type) |
static int[] |
indexes(Axis[] axes,
Predicate<Axis> predicate) |
static int[] |
invertPermutation(int[] p) |
static boolean |
isIdentityPermutation(int[] p) |
static int[] |
normalizeIndexes(int[] indexes)
Converters an array of integers to a normalized array of integers such that the smallest
integer is mapped to 0, the second smallest to 1 ... and the largest is mapped to N-1, where
N is the number of unique integers in the array.
|
static double[] |
permute(double[] in,
int[] p) |
static int[] |
permute(int[] in,
int[] p) |
static <T> List<T> |
permute(List<T> in,
int[] p) |
static long[] |
permute(long[] in,
int[] p) |
static <T> net.imglib2.view.IntervalView<T> |
permute(net.imglib2.RandomAccessibleInterval<T> source,
int[] p)
Permutes the dimensions of a
RandomAccessibleInterval
using the given permutation vector, where the ith value in p
gives destination of the ith input dimension in the output. |
static <T> void |
permute(T[] in,
T[] dest,
int[] p)
Permutes an input array into a destination array.
|
static <M extends AxisMetadata & N5Metadata> |
permuteForImagePlus(int[] spatialPermutation,
M meta) |
static <T,M extends AxisMetadata & N5Metadata> |
permuteForImagePlus(net.imglib2.RandomAccessibleInterval<T> img,
M meta) |
static <T,M extends N5Metadata,A extends AxisMetadata & N5Metadata> |
permuteImageAndMetadataForImagePlus(int[] p,
net.imglib2.RandomAccessibleInterval<T> img,
M meta) |
static <T,M extends N5Metadata,A extends AxisMetadata & N5Metadata> |
permuteImageAndMetadataForImagePlus(net.imglib2.RandomAccessibleInterval<T> img,
M meta) |
static <T> net.imglib2.RandomAccessibleInterval<T> |
reverseDimensions(net.imglib2.RandomAccessibleInterval<T> img) |
static Axis |
unknownAxis() |
public static final String xLabel
public static final String yLabel
public static final String cLabel
public static final String zLabel
public static final String tLabel
public static final String spaceType
public static final String timeType
public static final String channelType
public static final String unknownType
public static final AxisUtils.DefaultAxisTypes defaultAxisTypes
public static String SPACE_UNIT
public static String TIME_UNIT
public static <T> int[] findPermutation(T[] source,
T[] target)
T - the object typesource - the source objectstarget - the target objectspublic static <T> void permute(T[] in,
T[] dest,
int[] p)
T - the typein - the input arraydest - the destination arrayp - the permutationpublic static long[] permute(long[] in,
int[] p)
public static int[] permute(int[] in,
int[] p)
public static double[] permute(double[] in,
int[] p)
public static <A extends AxisMetadata> int[] findImagePlusPermutation(AxisMetadata axisMetadata)
A - the axis typeaxisMetadata - the axis metadatapublic static int[] findImagePlusPermutation(String[] axisLabels)
axisLabels - the axis labelspublic static int[] findImagePlusSpatialPermutation(int[] p)
public static int[] normalizeIndexes(int[] indexes)
indexes - the indexespublic static void fillPermutation(int[] p)
p - the permutationpublic static net.imglib2.realtransform.AffineGet axisPermutationTransform(int[] p)
public static boolean isIdentityPermutation(int[] p)
public static <T,M extends AxisMetadata & N5Metadata> net.imglib2.RandomAccessibleInterval<T> permuteForImagePlus(net.imglib2.RandomAccessibleInterval<T> img, M meta)
public static <M extends AxisMetadata & N5Metadata> M permuteForImagePlus(int[] spatialPermutation, M meta)
public static <T,M extends N5Metadata,A extends AxisMetadata & N5Metadata> net.imglib2.util.Pair<net.imglib2.RandomAccessibleInterval<T>,M> permuteImageAndMetadataForImagePlus(net.imglib2.RandomAccessibleInterval<T> img, M meta)
public static <T,M extends N5Metadata,A extends AxisMetadata & N5Metadata> net.imglib2.util.Pair<net.imglib2.RandomAccessibleInterval<T>,M> permuteImageAndMetadataForImagePlus(int[] p, net.imglib2.RandomAccessibleInterval<T> img, M meta)
public static <T> net.imglib2.RandomAccessibleInterval<T> reverseDimensions(net.imglib2.RandomAccessibleInterval<T> img)
public static final <T> net.imglib2.view.IntervalView<T> permute(net.imglib2.RandomAccessibleInterval<T> source, int[] p)
RandomAccessibleInterval
using the given permutation vector, where the ith value in p
gives destination of the ith input dimension in the output.T - the image typesource - the source datap - the permutationpublic static int[] invertPermutation(int[] p)
public static Axis[] defaultAxes(int N)
public static Axis unknownAxis()
public static DefaultAxisMetadata defaultN5ViewerAxes(N5SpatialDatasetMetadata meta)
meta - the metadatapublic static String defaultLabel(int i)
public static <T> boolean containsAny(Set<T> set, T[] array)
T - the typeset - the setarray - the arraypublic static <T> boolean contains(T t,
T[] array)
T - the typet - some elementarray - the arrayCopyright © 2021–2026 Saalfeld Lab. All rights reserved.