Class StackTester
Object
StackTester
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
FieldsModifier and TypeFieldDescriptionstatic final String
A constant identifier used to represent a small extent in file names. -
Constructor Summary
ConstructorsConstructorDescriptionStackTester
(StackWriter writer, Path directoryToWriteTo, String extension, boolean include3D) Creates a newStackTester
instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
performTest
(VoxelDataType[] channelVoxelTypes, int numberChannels, boolean makeRGB, Optional<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
(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<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.
-
Field Details
-
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 newStackTester
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 testnumberChannels
- Number of channels in the stackmakeRGB
- Whether to make the stack RGBcomparer
- Optional image comparer for asserting identity- Throws:
ImageIOException
- If an error occurs during image I/O operationsIOException
- 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 testnumberChannels
- Number of channels in the stackmakeRGB
- Whether to make the stack RGBforceFirstChannel
- Optional voxel data type to force for the first channelcomparer
- Optional image comparer for asserting identity- Throws:
ImageIOException
- If an error occurs during image I/O operationsIOException
- 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 testcomparer
- Optional image comparer for asserting identity- Throws:
ImageIOException
- If an error occurs during image I/O operationsIOException
- 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 testforceFirstChannel
- Optional voxel data type to force for the first channelcomparer
- Optional image comparer for asserting identity- Throws:
ImageIOException
- If an error occurs during image I/O operationsIOException
- If an I/O error occurs
-