Class ChannelConverter<T>

Object
ChannelConverter<T>
Type Parameters:
T - type to convert to (destination-type)
Direct Known Subclasses:
ToFloat, ToUnsignedByte, ToUnsignedByteScaleByMinMaxValue, ToUnsignedShort

public abstract class ChannelConverter<T> extends Object
Base class to convert Channels from one type to another specific type.
Author:
Owen Feehan
  • Constructor Details

    • ChannelConverter

      protected ChannelConverter(VoxelDataType targetDataType, VoxelsConverter<T> voxelsConverter, VoxelsFactoryTypeBound<T> voxelsFactory)
      Creates a new ChannelConverter instance.
      Parameters:
      targetDataType - The voxel data-type to convert each Channel's voxels to.
      voxelsConverter - A converter used to change the Voxels to targetDataType.
      voxelsFactory - The factory used to create new Voxels.
  • Method Details

    • convert

      public Stack convert(Stack stack, ConversionPolicy changeExisting)
      Like convert(Channel, ConversionPolicy) but converts every channel in a Stack.
      Parameters:
      stack - the stack whose channels will be converted.
      changeExisting - if true, the existing channels will be changed in-place, otherwise a new channel will be created.
      Returns:
      a newly created Stack containing converted versions of each respective channel in stack.
    • convert

      public Channel convert(Channel channel, ConversionPolicy changeExisting)
      Converts channel to have voxels with data-type T.

      This can occur by either replacing the existing voxels in the channel, or creating a new channel entirely.

      Parameters:
      channel - channel whose voxels will be converted.
      changeExisting - if true, the existing channels will be changed in-place, otherwise a new channel will be created.
      Returns:
      the converted channel, either the existing channel, or a newly-created one, as per above.
    • getVoxelsConverter

      public VoxelsConverter<T> getVoxelsConverter()
      A converter used to change the Voxels to targetDataType.