Class StackTester

Object
org.anchoranalysis.test.image.stackwriter.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 Summary

    Fields 
    Modifier and Type Field Description
    static String EXTENT_IDENTIFIER
    A constant identifier used to represent a small extent in file names.
  • Constructor Summary

    Constructors 
    Constructor Description
    StackTester​(StackWriter writer, Path directoryToWriteTo, String extension, boolean include3D)  
  • Method Summary

    Modifier and Type Method Description
    void performTest​(org.anchoranalysis.image.voxel.datatype.VoxelDataType[] channelVoxelTypes, int numberChannels, boolean makeRGB, Optional<org.anchoranalysis.image.voxel.datatype.VoxelDataType> forceFirstChannel, Optional<ImageComparer> comparer)
    Performs a test on stack writing for specified channel types, number of channels, RGB setting, and optional forced first channel type.
    void performTest​(org.anchoranalysis.image.voxel.datatype.VoxelDataType[] channelVoxelTypes, int numberChannels, boolean makeRGB, Optional<ImageComparer> comparer)
    Performs a test on stack writing for specified channel types, number of channels, and RGB setting.
    void performTest​(ChannelSpecification channels, Optional<org.anchoranalysis.image.voxel.datatype.VoxelDataType> forceFirstChannel, Optional<ImageComparer> comparer)
    Performs a test on stack writing for a specified channel specification and optional forced first channel type.
    void performTest​(ChannelSpecification channels, Optional<ImageComparer> comparer)
    Performs a test on stack writing for a specified channel specification.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      Constant Field Values
  • Constructor Details

  • Method Details

    • performTest

      public void performTest​(org.anchoranalysis.image.voxel.datatype.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​(org.anchoranalysis.image.voxel.datatype.VoxelDataType[] channelVoxelTypes, int numberChannels, boolean makeRGB, Optional<org.anchoranalysis.image.voxel.datatype.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<org.anchoranalysis.image.voxel.datatype.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