Class OpenCVReader

Object
org.anchoranalysis.bean.AnchorBean<org.anchoranalysis.image.io.bean.stack.reader.StackReader>
org.anchoranalysis.image.io.bean.stack.reader.StackReader
org.anchoranalysis.plugin.opencv.bean.stack.OpenCVReader

public class OpenCVReader
extends org.anchoranalysis.image.io.bean.stack.reader.StackReader
Reads a stack from the file-system using OpenCV.

Depending on whether the file-path is ASCII-encoded or not-ASCII encoded, this occurs via two different implementations.

The non-ASCII method seems to be approximately 4 times slower empirically.

See this Stack Overflow post for more details on the problem/

Note that when reading image metadata only, this is computionally slow, as the entire image must be loaded into memory to determine the width and height. Users are recommended to use another library for this purpose.

However, unlike many other libraries, OpenCV has the advantage of automatically correcting the orientation (to give correct widths and heights) where EXIF rotation information is present - but only for the ASCII-mathod.

Author:
Owen Feehan
  • Constructor Summary

    Constructors 
    Constructor Description
    OpenCVReader()  
  • Method Summary

    Modifier and Type Method Description
    void checkMisconfigured​(org.anchoranalysis.bean.BeanInstanceMap defaultInstances)  
    org.anchoranalysis.image.io.stack.input.OpenedImageFile openFile​(Path path, org.anchoranalysis.core.time.ExecutionTimeRecorder executionTimeRecorder)  

    Methods inherited from class org.anchoranalysis.image.io.bean.stack.reader.StackReader

    readStack

    Methods inherited from class org.anchoranalysis.bean.AnchorBean

    describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • checkMisconfigured

      public void checkMisconfigured​(org.anchoranalysis.bean.BeanInstanceMap defaultInstances) throws org.anchoranalysis.bean.exception.BeanMisconfiguredException
      Overrides:
      checkMisconfigured in class org.anchoranalysis.bean.AnchorBean<org.anchoranalysis.image.io.bean.stack.reader.StackReader>
      Throws:
      org.anchoranalysis.bean.exception.BeanMisconfiguredException
    • openFile

      public org.anchoranalysis.image.io.stack.input.OpenedImageFile openFile​(Path path, org.anchoranalysis.core.time.ExecutionTimeRecorder executionTimeRecorder) throws org.anchoranalysis.image.io.ImageIOException
      Specified by:
      openFile in class org.anchoranalysis.image.io.bean.stack.reader.StackReader
      Throws:
      org.anchoranalysis.image.io.ImageIOException