Package net.imglib2.util
Class ImgUtil
java.lang.Object
net.imglib2.util.ImgUtil
This class contains static methods for copying image data to and from Img
instances. It was developed to support access to imglib from applications
that can't rely on JIT compilation and that access imglib via the JVM or
through JNI (specifically CellProfiler).
- Author:
- Tobias Pietzsch, Stephan Preibisch, Stephan Saalfeld, Lee Kamentsky
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends BooleanType<T>>
voidstatic <T extends RealType<T>>
voidCopy a flat array of doubles into an Img.static <T extends RealType<T>>
voidstatic <T extends IntegerType<T>>
voidstatic <T extends IntegerType<T>>
voidstatic <T extends BooleanType<T>>
voidstatic <T extends RealType<T>>
voidCopy the contents of an Img to a double arraystatic <T extends RealType<T>>
voidstatic <T extends IntegerType<T>>
voidstatic <T extends IntegerType<T>>
void
-
Constructor Details
-
ImgUtil
public ImgUtil()
-
-
Method Details
-
copy
public static <T extends RealType<T>> void copy(double[] src, int offset, int[] stride, Img<T> dest) Copy a flat array of doubles into an Img. The flat array should be visualized as a series of concatenated rasters. Each raster element has an associated coordinate location. The stride array provides the address of that element: multiply the coordinate at each dimension by its corresponding stride and sum the result to get the address of the raster element. For instance, a 10 x 10 raster image has a stride of { 1, 10 }.- Type Parameters:
T
- - the type of the destination image data- Parameters:
src
- - the source of the data. This array must be large enough to encompass all addressed elements.offset
- - the offset to the element at the originstride
- - for each dimension, the multiplier in that dimension to address an axis element in that dimensiondest
- - the destination for the copy
-
copy
- See Also:
-
copy
public static <T extends IntegerType<T>> void copy(long[] src, int offset, int[] stride, Img<T> dest) - See Also:
-
copy
public static <T extends IntegerType<T>> void copy(int[] src, int offset, int[] stride, Img<T> dest) - See Also:
-
copy
public static <T extends BooleanType<T>> void copy(boolean[] src, int offset, int[] stride, Img<T> dest) - See Also:
-
copy
public static <T extends RealType<T>> void copy(Img<T> src, double[] dest, int offset, int[] stride) Copy the contents of an Img to a double array- Type Parameters:
T
- the Img's type- Parameters:
src
- copy data from this Imgdest
- the destination arrayoffset
- the offset to the origin element in the destination arraystride
- the stride into the destination array for each dimension- See Also:
-
copy
- See Also:
-
copy
public static <T extends IntegerType<T>> void copy(Img<T> src, long[] dest, int offset, int[] stride) - See Also:
-
copy
public static <T extends IntegerType<T>> void copy(Img<T> src, int[] dest, int offset, int[] stride) - See Also:
-
copy
public static <T extends BooleanType<T>> void copy(Img<T> src, boolean[] dest, int offset, int[] stride) - See Also:
-