Object
ComparisonPlan

public final class ComparisonPlan extends Object
A plan on which comparisons to execute for a test.
Author:
Owen Feehan
  • Constructor Details

    • ComparisonPlan

      public ComparisonPlan(boolean bytewiseCompare, Optional<ImageFileFormat> formatVoxelwiseCompare, boolean skipComparisonForRGB)
      Creates a plan for particular settings.
      Parameters:
      bytewiseCompare - iff true, a bytewise comparison occurs between the saved-file and the newly created file.
      formatVoxelwiseCompare - iff defined, a voxel-wise comparison occurs with the saved-rasters from a different format.
      skipComparisonForRGB - if true, comparisons are not applied to RGB images.
    • ComparisonPlan

      public ComparisonPlan(boolean bytewiseCompare, Optional<ImageFileFormat> formatVoxelwiseCompare, boolean skipComparisonForRGB, String directoryPathToCopyMissingImagesTo)
      Creates a plan for particular settings - and which copies any missing images to a particular directory.

      This helps create resource directories of saved-images, if they are missing.

      Parameters:
      bytewiseCompare - iff true, a bytewise comparison occurs between the saved-file and the newly created file.
      formatVoxelwiseCompare - iff defined, a voxel-wise comparison occurs with the saved-rasters from a different file-format.
      skipComparisonForRGB - if true, comparisons are not applied to RGB images.
      directoryPathToCopyMissingImagesTo - a path to a directory to copy images to if a test fails (which we assume is evidence the image is missing).
  • Method Details

    • createComparer

      public ImageComparer createComparer(Path directory, String extension)
      Creates the ImageComparer to use to compare between images loaded in a temporary-directory and saved-images.
      Parameters:
      directory - the temporary-directory where an image is created to be compared
      extension - the file-extension used in the temporary-directory
      Returns:
      a newly created comparer
    • isBytewiseCompare

      public boolean isBytewiseCompare()
    • getFormatVoxelwiseCompare

      public Optional<ImageFileFormat> getFormatVoxelwiseCompare()
      The file-format to use for the voxel-wise comparison (if it's activated).
    • isSkipComparisonForRGB

      public boolean isSkipComparisonForRGB()
    • getDirectoryPathToCopyMissingImagesTo

      public Optional<String> getDirectoryPathToCopyMissingImagesTo()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object