Class ConvertToImg
Object
ConvertToImg
- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic net.imglib2.img.Img<? extends net.imglib2.type.numeric.RealType<?>> from(VoxelsUntyped voxels) Converts from aVoxelsUntyped(Anchor structure) to aImg(ImgLib2 structure).static net.imglib2.img.Img<net.imglib2.type.numeric.integer.UnsignedByteType> fromByte(VoxelBuffer<UnsignedByteBuffer> buffer, Extent extent) Creates anImgfrom aVoxelBufferwith an unsigned byte data-type.static net.imglib2.img.Img<net.imglib2.type.numeric.integer.UnsignedByteType> fromByte(Voxels<UnsignedByteBuffer> voxels) Creates anImgfromVoxelswith an unsigned byte data-type.static net.imglib2.img.Img<net.imglib2.type.numeric.real.FloatType> fromFloat(VoxelBuffer<FloatBuffer> buffer, Extent extent) Creates anImgfrom aVoxelBufferwith a float data-type.static net.imglib2.img.Img<net.imglib2.type.numeric.real.FloatType> fromFloat(Voxels<FloatBuffer> voxels) Creates anImgfromVoxelswith a float data-type.static net.imglib2.img.Img<net.imglib2.type.numeric.integer.UnsignedShortType> fromShort(VoxelBuffer<UnsignedShortBuffer> buffer, Extent extent) Creates anImgfrom aVoxelBufferwith an unsigned short data-type.static net.imglib2.img.Img<net.imglib2.type.numeric.integer.UnsignedShortType> fromShort(Voxels<UnsignedShortBuffer> voxels) Creates anImgfromVoxelswith an unsigned short data-type.static net.imglib2.img.Img<? extends net.imglib2.type.numeric.RealType<?>> fromSlice(VoxelsUntyped voxels, int sliceIndex) Creates anImgfrom a single z-slice of aVoxelsUntyped.
-
Method Details
-
from
public static net.imglib2.img.Img<? extends net.imglib2.type.numeric.RealType<?>> from(VoxelsUntyped voxels) Converts from aVoxelsUntyped(Anchor structure) to aImg(ImgLib2 structure).The voxel buffers are reused (without duplication).
- Parameters:
voxels- the voxels to convert.- Returns:
- an
Imgobject reusing the buffers ofvoxels.
-
fromSlice
public static net.imglib2.img.Img<? extends net.imglib2.type.numeric.RealType<?>> fromSlice(VoxelsUntyped voxels, int sliceIndex) Creates anImgfrom a single z-slice of aVoxelsUntyped.- Parameters:
voxels- the voxels to extract z-slice from to create aImg.sliceIndex- the index of the slice in the z dimension.- Returns:
- a newly created
Img, either reusing the memory invoxelsor else a copy of it.
-
fromByte
public static net.imglib2.img.Img<net.imglib2.type.numeric.integer.UnsignedByteType> fromByte(VoxelBuffer<UnsignedByteBuffer> buffer, Extent extent) Creates anImgfrom aVoxelBufferwith an unsigned byte data-type.- Parameters:
buffer- the buffer to use for the voxels in theImg.extent- the size of the image, whose volume should matchbuffer's size exactly.- Returns:
- the newly created
Img, either reusing the memory inbufferor else a copy of it.
-
fromShort
public static net.imglib2.img.Img<net.imglib2.type.numeric.integer.UnsignedShortType> fromShort(VoxelBuffer<UnsignedShortBuffer> buffer, Extent extent) Creates anImgfrom aVoxelBufferwith an unsigned short data-type.- Parameters:
buffer- the buffer to use for the voxels in theImg.extent- the size of the image, whose volume should matchbuffer's size exactly.- Returns:
- the newly created
Img, either reusing the memory inbufferor else a copy of it.
-
fromFloat
public static net.imglib2.img.Img<net.imglib2.type.numeric.real.FloatType> fromFloat(VoxelBuffer<FloatBuffer> buffer, Extent extent) Creates anImgfrom aVoxelBufferwith a float data-type.- Parameters:
buffer- the buffer to use for the voxels in theImg.extent- the size of the image, whose volume should matchbuffer's size exactly.- Returns:
- the newly created
Img,either reusing the memory inbufferor else a copy of it.
-
fromByte
public static net.imglib2.img.Img<net.imglib2.type.numeric.integer.UnsignedByteType> fromByte(Voxels<UnsignedByteBuffer> voxels) Creates anImgfromVoxelswith an unsigned byte data-type.- Parameters:
voxels- the voxels to use in theImg.- Returns:
- the newly created
Img, either reusing the memory invoxelsor else a copy of it.
-
fromShort
public static net.imglib2.img.Img<net.imglib2.type.numeric.integer.UnsignedShortType> fromShort(Voxels<UnsignedShortBuffer> voxels) Creates anImgfromVoxelswith an unsigned short data-type.- Parameters:
voxels- the voxels to use in theImg.- Returns:
- the newly created
Img, either reusing the memory invoxelsor else a copy of it.
-
fromFloat
public static net.imglib2.img.Img<net.imglib2.type.numeric.real.FloatType> fromFloat(Voxels<FloatBuffer> voxels) Creates anImgfromVoxelswith a float data-type.- Parameters:
voxels- the voxels to use in theImg.- Returns:
- the newly created
Img, either reusing the memory invoxelsor else a copy of it.
-