Class StackTester

Object
StackTester

public class StackTester extends Object
A utility class for testing stack writers by writing stacks and optionally comparing them.

This class provides methods to perform various tests on stack writing operations, including support for different channel specifications, data types, and dimensionality.

  • Field Details

    • EXTENT_IDENTIFIER

      public static final String EXTENT_IDENTIFIER
      A constant identifier used to represent a small extent in file names.

      This identifier is used when constructing file names for test images, indicating that the image has a small spatial extent.

      See Also:
  • Constructor Details

    • StackTester

      public StackTester(StackWriter writer, Path directoryToWriteTo, String extension, boolean include3D)
      Creates a new StackTester instance.
      Parameters:
      writer - The writer to use for creating new raster-files that are tested for bytewise equality against saved rasters.
      directoryToWriteTo - The directory to write new files to.
      extension - The file-extension to use for writing and testing files (case-sensitive, and without a leading period).
      include3D - If true, then 3D stacks are also tested and saved, not just 2D stacks.
  • Method Details

    • performTest

      public void performTest(VoxelDataType[] channelVoxelTypes, int numberChannels, boolean makeRGB, Optional<ImageComparer> comparer) throws ImageIOException, IOException
      Performs a test on stack writing for specified channel types, number of channels, and RGB setting.
      Parameters:
      channelVoxelTypes - Array of voxel data types to test
      numberChannels - Number of channels in the stack
      makeRGB - Whether to make the stack RGB
      comparer - Optional image comparer for asserting identity
      Throws:
      ImageIOException - If an error occurs during image I/O operations
      IOException - If an I/O error occurs
    • performTest

      public void performTest(VoxelDataType[] channelVoxelTypes, int numberChannels, boolean makeRGB, Optional<VoxelDataType> forceFirstChannel, Optional<ImageComparer> comparer) throws ImageIOException, IOException
      Performs a test on stack writing for specified channel types, number of channels, RGB setting, and optional forced first channel type.
      Parameters:
      channelVoxelTypes - Array of voxel data types to test
      numberChannels - Number of channels in the stack
      makeRGB - Whether to make the stack RGB
      forceFirstChannel - Optional voxel data type to force for the first channel
      comparer - Optional image comparer for asserting identity
      Throws:
      ImageIOException - If an error occurs during image I/O operations
      IOException - If an I/O error occurs
    • performTest

      public void performTest(ChannelSpecification channels, Optional<ImageComparer> comparer) throws ImageIOException, IOException
      Performs a test on stack writing for a specified channel specification.
      Parameters:
      channels - The channel specification to test
      comparer - Optional image comparer for asserting identity
      Throws:
      ImageIOException - If an error occurs during image I/O operations
      IOException - If an I/O error occurs
    • performTest

      public void performTest(ChannelSpecification channels, Optional<VoxelDataType> forceFirstChannel, Optional<ImageComparer> comparer) throws ImageIOException, IOException
      Performs a test on stack writing for a specified channel specification and optional forced first channel type.
      Parameters:
      channels - The channel specification to test
      forceFirstChannel - Optional voxel data type to force for the first channel
      comparer - Optional image comparer for asserting identity
      Throws:
      ImageIOException - If an error occurs during image I/O operations
      IOException - If an I/O error occurs