Class VoxelsConverter<T>
Object
org.anchoranalysis.image.voxel.convert.VoxelsConverter<T>
- Type Parameters:
T- destination-type (what the voxels will be converted to).
- Direct Known Subclasses:
ToFloatNoScaling,ToUnsignedByte,ToUnsignedInt,ToUnsignedShortNoScaling,ToUnsignedShortScaleByType
public abstract class VoxelsConverter<T> extends Object
Converts voxels from one data-type to another.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description VoxelsConverter() -
Method Summary
Modifier and Type Method Description protected abstract voidconvertFloat(FloatBuffer in, T out)Copies a value from the current position in aFloatBufferto the current position in a buffer of typeT.Voxels<T>convertFrom(VoxelsUntyped from, VoxelsFactoryTypeBound<T> factory)Creates a new voxels of typeTand copies the voxels fromfrom.protected abstract voidconvertUnsignedByte(UnsignedByteBuffer in, T out)Copies a value from the current position in aUnsignedByteBufferto the current position in a buffer of typeT.protected abstract voidconvertUnsignedInt(UnsignedIntBuffer in, T out)Copies a value from the current position in aUnsignedIntBufferto the current position in a buffer of typeT.protected abstract voidconvertUnsignedShort(UnsignedShortBuffer in, T out)Copies a value from the current position in aUnsignedShortBufferto the current position in a buffer of typeT.voidcopyFrom(VoxelsUntyped from, Voxels<T> to)Copies voxels from a source (of any type) to voxels of typeT.voidcopyFromFloat(Voxels<FloatBuffer> from, Voxels<T> to)Copies voxels from a source of type @{link FloatBuffer} to voxels of typeT.voidcopyFromUnsignedByte(Voxels<UnsignedByteBuffer> from, Voxels<T> to)Copies voxels from a source of type @{link UnsignedByteBuffer} to voxels of typeT.voidcopyFromUnsignedInt(Voxels<UnsignedIntBuffer> from, Voxels<T> to)Copies voxels from a source of type @{link UnsignedIntBuffer} to voxels of typeT.voidcopyFromUnsignedShort(Voxels<UnsignedShortBuffer> from, Voxels<T> to)Copies voxels from a source of type @{link UnsignedShortBuffer} to voxels of typeT.
-
Constructor Details
-
VoxelsConverter
public VoxelsConverter()
-
-
Method Details
-
convertFrom
Creates a new voxels of typeTand copies the voxels fromfrom. -
copyFrom
Copies voxels from a source (of any type) to voxels of typeT.- Parameters:
from- where the voxels are copied from (the source)to- where the voxels are copied to (the destination)- Throws:
OperationFailedException- if the extents offromandtoare not equal.
-
copyFromUnsignedByte
public void copyFromUnsignedByte(Voxels<UnsignedByteBuffer> from, Voxels<T> to) throws OperationFailedExceptionCopies voxels from a source of type @{link UnsignedByteBuffer} to voxels of typeT.- Parameters:
from- where the voxels are copied from (the source).to- where the voxels are copied to (the destination).- Throws:
OperationFailedException- if the extents offromandtoare not equal.
-
copyFromUnsignedShort
public void copyFromUnsignedShort(Voxels<UnsignedShortBuffer> from, Voxels<T> to) throws OperationFailedExceptionCopies voxels from a source of type @{link UnsignedShortBuffer} to voxels of typeT.- Parameters:
from- where the voxels are copied from (the source).to- where the voxels are copied to (the destination).- Throws:
OperationFailedException- if the extents offromandtoare not equal.
-
copyFromUnsignedInt
public void copyFromUnsignedInt(Voxels<UnsignedIntBuffer> from, Voxels<T> to) throws OperationFailedExceptionCopies voxels from a source of type @{link UnsignedIntBuffer} to voxels of typeT.- Parameters:
from- where the voxels are copied from (the source).to- where the voxels are copied to (the destination).- Throws:
OperationFailedException- if the extents offromandtoare not equal.
-
copyFromFloat
Copies voxels from a source of type @{link FloatBuffer} to voxels of typeT.- Parameters:
from- where the voxels are copied from (the source).to- where the voxels are copied to (the destination).- Throws:
OperationFailedException- if the extents offromandtoare not equal.
-
convertUnsignedByte
Copies a value from the current position in aUnsignedByteBufferto the current position in a buffer of typeT.- Parameters:
in- the current position of this buffer gives the value to convert, and the position is incremented.out- the converted value is written to the current position of this buffer, and the position is incremented.
-
convertUnsignedShort
Copies a value from the current position in aUnsignedShortBufferto the current position in a buffer of typeT.- Parameters:
in- the current position of this buffer gives the value to convert, and the position is incremented.out- the converted value is written to the current position of this buffer, and the position is incremented.
-
convertUnsignedInt
Copies a value from the current position in aUnsignedIntBufferto the current position in a buffer of typeT.- Parameters:
in- the current position of this buffer gives the value to convert, and the position is incremented.out- the converted value is written to the current position of this buffer, and the position is incremented.
-
convertFloat
Copies a value from the current position in aFloatBufferto the current position in a buffer of typeT.- Parameters:
in- the current position of this buffer gives the value to convert, and the position is incremented.out- the converted value is written to the current position of this buffer, and the position is incremented.
-