Class ImageSizePrereader

Object
ImageSizePrereader

public class ImageSizePrereader extends Object
Reads the size of each image initially, before normal (parallel) task execution.

It first attempts to do this through a imageMetadataReader as often this is much faster than opening the stack with StackReader.

Author:
Owen Feehan
  • Constructor Details

    • ImageSizePrereader

      public ImageSizePrereader(ImageMetadataReader imageMetadataReader, StackReader stackReader, OperationContext context)
      Creates a new ImageSizePrereader instance.
      Parameters:
      imageMetadataReader - How to read the ImageMetadata from the file-system.
      stackReader - Fallback for imageMetadataReader to read image files without a directy metadata reader.
      context - Logging and execution time recording.
  • Method Details

    • imageSizesFor

      public List<SizeMapping> imageSizesFor(List<StackSequenceInput> inputs)
      Extract the image-size for each StackSequenceInput.
      Parameters:
      inputs - the input images.
      Returns:
      a newly created list of the image-sizes for each input. This may not be the size size as paths, as if an error occurs, the element is dropped.