Class PermutationTransform
- java.lang.Object
-
- net.imglib2.transform.integer.permutation.AbstractPermutationTransform
-
- net.imglib2.transform.integer.permutation.PermutationTransform
-
- All Implemented Interfaces:
InvertibleTransform
,Transform
public class PermutationTransform extends AbstractPermutationTransform
Bijective integer transform mapping between integer coordinates in [0,n-1].- Author:
- Stephan Saalfeld, Philipp Hanslovsky
-
-
Field Summary
Fields Modifier and Type Field Description protected int
numSourceDimensions
protected int
numTargetDimensions
-
Fields inherited from class net.imglib2.transform.integer.permutation.AbstractPermutationTransform
inverseLut, lut
-
-
Constructor Summary
Constructors Constructor Description PermutationTransform(int[] lut, int numSourceDimensions, int numTargetDimensions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(int[] source, int[] target)
Apply theTransform
to a source vector to obtain a target vector.void
apply(long[] source, long[] target)
Apply theTransform
to a source vector to obtain a target vector.void
apply(Localizable source, Positionable target)
void
applyInverse(int[] source, int[] target)
Apply the inverse transform to a target vector to obtain a source vector.void
applyInverse(long[] source, long[] target)
Apply the inverse transform to a target vector to obtain a source vector.void
applyInverse(Positionable source, Localizable target)
Apply the inverse transform to a targetLocalizable
to obtain a sourcePositionable
.static boolean
checkInterval(Interval interval, int[] lut)
Test whether a given lut can be applied to an interval.PermutationTransform
inverse()
Get the inverse transform.int
numSourceDimensions()
Returns n, the dimension of the source vector.int
numTargetDimensions()
Returns m, the dimension of the target vector.-
Methods inherited from class net.imglib2.transform.integer.permutation.AbstractPermutationTransform
apply, applyChecked, applyInverse, applyInverseChecked, checkBijectivity, getInverseLutCopy, getLutCopy
-
-
-
-
Constructor Detail
-
PermutationTransform
public PermutationTransform(int[] lut, int numSourceDimensions, int numTargetDimensions)
- Parameters:
lut
- must be a bijective permutation over its index set, i.e. for a lut of length n, the sorted content the array must be [0,...,n-1] which is the index set of the lut.numSourceDimensions
-numTargetDimensions
-
-
-
Method Detail
-
numSourceDimensions
public int numSourceDimensions()
Description copied from interface:Transform
Returns n, the dimension of the source vector.- Returns:
- the dimension of the source vector.
-
numTargetDimensions
public int numTargetDimensions()
Description copied from interface:Transform
Returns m, the dimension of the target vector.- Returns:
- the dimension of the target vector.
-
apply
public void apply(long[] source, long[] target)
Description copied from interface:Transform
Apply theTransform
to a source vector to obtain a target vector.- Parameters:
source
- source coordinates.target
- set this to the target coordinates.
-
apply
public void apply(int[] source, int[] target)
Description copied from interface:Transform
Apply theTransform
to a source vector to obtain a target vector.- Parameters:
source
- source coordinates.target
- set this to the target coordinates.
-
apply
public void apply(Localizable source, Positionable target)
Description copied from interface:Transform
- Parameters:
source
- source coordinates.target
- set this to the target coordinates.
-
applyInverse
public void applyInverse(long[] source, long[] target)
Description copied from interface:InvertibleTransform
Apply the inverse transform to a target vector to obtain a source vector.- Parameters:
source
- set this to the source coordinates.target
- target coordinates.
-
applyInverse
public void applyInverse(int[] source, int[] target)
Description copied from interface:InvertibleTransform
Apply the inverse transform to a target vector to obtain a source vector.- Parameters:
source
- set this to the source coordinates.target
- target coordinates.
-
applyInverse
public void applyInverse(Positionable source, Localizable target)
Description copied from interface:InvertibleTransform
Apply the inverse transform to a targetLocalizable
to obtain a sourcePositionable
.- Parameters:
source
- set this to the source coordinates.target
- target coordinates.
-
inverse
public PermutationTransform inverse()
Description copied from interface:InvertibleTransform
Get the inverse transform.- Returns:
- the inverse transform
-
checkInterval
public static boolean checkInterval(Interval interval, int[] lut)
Test whether a given lut can be applied to an interval. This means that the interval is a hypercube at min = 0n with size = lut.length.- Parameters:
interval
-lut
-- Returns:
-
-