Class VoxelsConverterMulti

Object
org.anchoranalysis.image.voxel.convert.VoxelsConverterMulti

public class VoxelsConverterMulti
extends Object
Converts a channel from one voxel data-type to one of multiple other types.
Author:
Owen Feehan
  • Constructor Details

  • Method Details

    • convert

      public <S,​ T> Voxels<S> convert​(VoxelsUntyped voxels, VoxelsFactoryTypeBound<T> outputVoxelsFactory)
      Converts a Voxels to another type.

      If outputVoxelType matches the existing data-type, the existing voxels is returned uncchanged.

      Otherwise a new Voxels of identical size is created for the new type.

      Type Parameters:
      S - voxel data type to convert from.
      T - voxel data type to convert to.
      Parameters:
      voxels - the voxels to convert.
      outputVoxelsFactory - a factory for creating the data-type to convert to.
      Returns:
      a Voxels to match outputVoxelsFactory, either reused (if already identical, or newly-created).