Class ConvertToImageProcessor

Object
ConvertToImageProcessor

public class ConvertToImageProcessor extends Object
Converts other voxel data-structures (as used by Anchor) to an ImageJ ImageProcessor.
Author:
Owen Feehan
  • Method Details

    • from

      public static ij.process.ImageProcessor from(VoxelsUntyped voxels, int z) throws ImageJConversionException
      Creates a ImageProcessor by extracting a slice from a VoxelsUntyped.
      Parameters:
      voxels - the voxels to extract a slice from.
      z - slice-index.
      Returns:
      a newly created image-procesor (reusing the existing buffer).
      Throws:
      ImageJConversionException - if the voxels are neither unsigned byte nor unsigned short (the only two supported types).
    • fromByte

      public static ij.process.ImageProcessor fromByte(SliceBufferIndex<UnsignedByteBuffer> pixelsForSlice, int z)
      Creates a ImageProcessor by extracting a slice from a SliceBufferIndex of type UnsignedByteBuffer.
      Parameters:
      pixelsForSlice - the pixels to extract a slice from.
      z - slice-index.
      Returns:
      a newly created image-processor (reusing the existing buffer).
    • fromShort

      public static ij.process.ImageProcessor fromShort(SliceBufferIndex<UnsignedShortBuffer> pixelsForSlice, int z)
      Creates a ImageProcessor by extracting a slice from a SliceBufferIndex of type UnsignedShortBuffer.
      Parameters:
      pixelsForSlice - the pixels to extract a slice from.
      z - slice-index.
      Returns:
      a newly created image-processor (reusing the existing buffer).
    • fromByte

      public static ij.process.ImageProcessor fromByte(VoxelBuffer<UnsignedByteBuffer> slice, Extent extent)
      Creates a ImageProcessor from voxel-buffer (of type ByteBuffer) that is already a slice.
      Parameters:
      slice - the voxels representing a slice
      extent - the size of image to create
      Returns:
      a newly created image-processor (reusing the existing buffer).
    • fromShort

      public static ij.process.ImageProcessor fromShort(VoxelBuffer<UnsignedShortBuffer> slice, Extent extent)
      Creates a ImageProcessor from voxel-buffer (of type ShortBuffer) that is already a slice.
      Parameters:
      slice - the voxels representing a slice.
      extent - the size of image to create.
      Returns:
      a newly created image-processor (reusing the existing buffer).
    • fromFloat

      public static ij.process.ImageProcessor fromFloat(VoxelBuffer<FloatBuffer> slice, Extent extent)
      Creates a ImageProcessor from voxel-buffer (of type FloatBuffer) that is already a slice.
      Parameters:
      slice - the voxels representing a slice.
      extent - the size of image to create.
      Returns:
      a newly created image-processor (reusing the existing buffer).