Class UnsignedByteFromUnsignedByteNoInterleavingScale
Object
ConvertTo<UnsignedByteBuffer>
ToUnsignedByte
ToUnsignedByteWithScaling
UnsignedByteFromUnsignedByteNoInterleavingScale
Converts data of type unsigned byte to unsigned byte.
Scaling is always applied to map the range of effective-bits (how many bits are used) to an 8-bit range.
Computationally, it is preferable to use UnsignedByteFromUnsignedByteNoInterleaving if
both source and destination are exactly 8-bit and unsigned.
- Author:
- Owen Feehan
-
Field Summary
Fields inherited from class org.anchoranalysis.io.bioformats.copyconvert.tobyte.ToUnsignedByteWithScaling
scalingFields inherited from class org.anchoranalysis.io.bioformats.copyconvert.ConvertTo
destinationSize, extent, sourceIncrement, sourceSize -
Constructor Summary
ConstructorsConstructorDescriptionUnsignedByteFromUnsignedByteNoInterleavingScale(int effectiveBits) Create with a number of effective-bits. -
Method Summary
Modifier and TypeMethodDescriptionprotected intThe number bytes to describe each source-voxel.protected intextractScaledValue(byte[] sourceArray, int index, boolean littleEndian) Extracts a value from the source-array, and apply any scaling and clamping.Methods inherited from class org.anchoranalysis.io.bioformats.copyconvert.tobyte.ToUnsignedByteWithScaling
copyChangeOrientation, copyKeepOrientation, supportsMultipleChannelsPerSourceBufferMethods inherited from class org.anchoranalysis.io.bioformats.copyconvert.ConvertTo
convert, convertSliceOfSingleChannel, copyAllChannels, setupBefore
-
Constructor Details
-
UnsignedByteFromUnsignedByteNoInterleavingScale
public UnsignedByteFromUnsignedByteNoInterleavingScale(int effectiveBits) Create with a number of effective-bits.- Parameters:
effectiveBits- the number of bits that are used in the input-type e.g. 8 or 12 or 16.
-
-
Method Details
-
bytesPerVoxel
protected int bytesPerVoxel()Description copied from class:ConvertToThe number bytes to describe each source-voxel.- Specified by:
bytesPerVoxelin classConvertTo<UnsignedByteBuffer>- Returns:
- the number of bytes.
-
extractScaledValue
protected int extractScaledValue(byte[] sourceArray, int index, boolean littleEndian) Description copied from class:ToUnsignedByteWithScalingExtracts a value from the source-array, and apply any scaling and clamping.- Specified by:
extractScaledValuein classToUnsignedByteWithScaling- Parameters:
sourceArray- the bytes from which some values are extracted.index- the offset insourceArrayfrom which a value is read.littleEndian- true iff the bytes insourceare in little-endian order.- Returns:
- the extracted value.
-