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 anImg
from aVoxelBuffer
with an unsigned byte data-type.static net.imglib2.img.Img
<net.imglib2.type.numeric.integer.UnsignedByteType> fromByte
(Voxels<UnsignedByteBuffer> voxels) Creates anImg
fromVoxels
with an unsigned byte data-type.static net.imglib2.img.Img
<net.imglib2.type.numeric.real.FloatType> fromFloat
(VoxelBuffer<FloatBuffer> buffer, Extent extent) Creates anImg
from aVoxelBuffer
with a float data-type.static net.imglib2.img.Img
<net.imglib2.type.numeric.real.FloatType> fromFloat
(Voxels<FloatBuffer> voxels) Creates anImg
fromVoxels
with a float data-type.static net.imglib2.img.Img
<net.imglib2.type.numeric.integer.UnsignedShortType> fromShort
(VoxelBuffer<UnsignedShortBuffer> buffer, Extent extent) Creates anImg
from aVoxelBuffer
with an unsigned short data-type.static net.imglib2.img.Img
<net.imglib2.type.numeric.integer.UnsignedShortType> fromShort
(Voxels<UnsignedShortBuffer> voxels) Creates anImg
fromVoxels
with an unsigned short data-type.static net.imglib2.img.Img
<? extends net.imglib2.type.numeric.RealType<?>> fromSlice
(VoxelsUntyped voxels, int sliceIndex) Creates anImg
from 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
Img
object reusing the buffers ofvoxels
.
-
fromSlice
public static net.imglib2.img.Img<? extends net.imglib2.type.numeric.RealType<?>> fromSlice(VoxelsUntyped voxels, int sliceIndex) Creates anImg
from 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 invoxels
or 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 anImg
from aVoxelBuffer
with 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 inbuffer
or 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 anImg
from aVoxelBuffer
with 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 inbuffer
or 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 anImg
from aVoxelBuffer
with 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 inbuffer
or else a copy of it.
-
fromByte
public static net.imglib2.img.Img<net.imglib2.type.numeric.integer.UnsignedByteType> fromByte(Voxels<UnsignedByteBuffer> voxels) Creates anImg
fromVoxels
with an unsigned byte data-type.- Parameters:
voxels
- the voxels to use in theImg
.- Returns:
- the newly created
Img
, either reusing the memory invoxels
or else a copy of it.
-
fromShort
public static net.imglib2.img.Img<net.imglib2.type.numeric.integer.UnsignedShortType> fromShort(Voxels<UnsignedShortBuffer> voxels) Creates anImg
fromVoxels
with an unsigned short data-type.- Parameters:
voxels
- the voxels to use in theImg
.- Returns:
- the newly created
Img
, either reusing the memory invoxels
or else a copy of it.
-
fromFloat
public static net.imglib2.img.Img<net.imglib2.type.numeric.real.FloatType> fromFloat(Voxels<FloatBuffer> voxels) Creates anImg
fromVoxels
with a float data-type.- Parameters:
voxels
- the voxels to use in theImg
.- Returns:
- the newly created
Img
, either reusing the memory invoxels
or else a copy of it.
-