Interface PlanePyramidSource

All Known Implementing Classes:
AbstractPlanePyramidSource, AbstractPlanePyramidSourceWrapper, CombinedPlanePyramidSource, DefaultPlanePyramidSource, DelayedPlanePyramidSource, ExtendingPlanePyramidSource, ImageIOPlanePyramidSource, RotatingPlanePyramidSource, ScalablePlanePyramidSource

public interface PlanePyramidSource
  • Field Details

    • DIM_BAND

      static final int DIM_BAND
      See Also:
    • DIM_WIDTH

      static final int DIM_WIDTH
      See Also:
    • DIM_HEIGHT

      static final int DIM_HEIGHT
      See Also:
    • DEFAULT_COMPRESSION

      static final int DEFAULT_COMPRESSION
    • DEFAULT_TILE_DIM

      static final long DEFAULT_TILE_DIM
    • DEFAULT_MINIMAL_PYRAMID_SIZE

      static final long DEFAULT_MINIMAL_PYRAMID_SIZE
      See Also:
  • Method Details

    • numberOfResolutions

      int numberOfResolutions()
    • compression

      int compression()
    • bandCount

      int bandCount()
    • getResolutionLevelsAvailability

      boolean[] getResolutionLevelsAvailability()
    • isResolutionLevelAvailable

      boolean isResolutionLevelAvailable(int resolutionLevel)
    • dimensions

      long[] dimensions(int resolutionLevel) throws NoSuchElementException

      Returns dimensions of any pyramid level. Number of elements in the result arrays is always 3:

      • first element result[0] is always equal to bandCount();
      • the element result[DIM_WIDTH] is the x-dimension of the level in pixels;
      • the element result[DIM_HEIGHT] is the y-dimension of the level in pixels.

      This method always returns a new Java array and never returns a reference to an internal field.

      Parameters:
      resolutionLevel - the level of pyramid; zero level (resolutionLevel=0) corresponds to the best resolution.
      Returns:
      dimensions of the specified pyramid level.
      Throws:
      NoSuchElementException - if !isResolutionLevelAvailable(resolutionLevel)
    • dim

      default long dim(int resolutionLevel, int index)
      Returns the dimension #index of the given pyramid level. Equivalent to dimensions(resolutionLevel)[index], but works faster.
      Parameters:
      index - the index of dimension.
      Returns:
      the dimension #index of this level.
      Throws:
      IndexOutOfBoundsException - if index<0 or index>2.
    • width

      default long width(int resolutionLevel)
    • height

      default long height(int resolutionLevel)
    • isElementTypeSupported

      boolean isElementTypeSupported()
      Returns true if elementType() method works properly. In other case, that method throws UnsupportedOperationException. In particular, returns true in DefaultPlanePyramidSource.
      Returns:
      whether elementType() is supported.
    • elementType

      Class<?> elementType() throws UnsupportedOperationException
      Throws:
      UnsupportedOperationException
    • pixelSizeInMicrons

      default OptionalDouble pixelSizeInMicrons()
    • magnification

      default OptionalDouble magnification()
    • zeroLevelActualRectangles

      default List<net.algart.math.IRectangularArea> zeroLevelActualRectangles()

      Returns a set of all areas, which are 2D rectangles, filled by actual data, at the zero level. All other areas should be considered to be a background and may be not passed to image analysis algorithms.

      Some pyramids, including the default implementation in AbstractPlanePyramidSource, do not support this feature. In this case, the method returns null. This situation may be interpreted as if we have only 1 actual area, corresponding to the whole pyramid from (0, 0) to (dimensions(0)[DIM_WIDTH]−1, dimensions(0)[DIM_HEIGHT]−1).

      Returns:
      a list of all areas (2D rectangles), filled by actual data, at the level #0, or null if it is not supported.
    • zeroLevelActualAreaBoundaries

      default List<List<List<net.algart.math.IPoint>>> zeroLevelActualAreaBoundaries()

      Returns a set of all areas, filled by actual data, at the zero level, in a form of a list of polygons, represented by their consecutive vertices. All other areas should be considered to be a background and may be not passed to image analysis algorithms.

      More precisely, each element P of the returned list, i.e. List<List<IPoint>>, corresponds to one connected 2D polygon. The structure of this element P is the following:

      • P.get(0) is the list of sequential vertices of the polygon; each vertex appears in this list only once;
      • P.get(1), P.get(2), ..., P.get(m), where m=P.size() describe sequential vertices of all polygonal holes, that may appear in the polygon. If the polygon has no holes (very probable case) or if their detection is not supported, the list P contains only 1 element (m=1).

      The default implementation in AbstractPlanePyramidSource calls zeroLevelActualRectangles() and converts each rectangle to the list P, containing only 1 element, and this element is the list of 4 vertices of the rectangle. If zeroLevelActualRectangles() returns null, the default implementation also returns null.

      Returns:
      the list of all polygonal areas, filled by actual data, at the level #0, and their holes (if they exist), or null if this ability is not supported.
    • readSubMatrix

      net.algart.arrays.Matrix<? extends net.algart.arrays.PArray> readSubMatrix(int resolutionLevel, long fromX, long fromY, long toX, long toY) throws NoSuchElementException, NotYetConnectedException
      Throws:
      NoSuchElementException
      NotYetConnectedException
    • isFullMatrixSupported

      default boolean isFullMatrixSupported()
    • readFullMatrix

      net.algart.arrays.Matrix<? extends net.algart.arrays.PArray> readFullMatrix(int resolutionLevel) throws NoSuchElementException, NotYetConnectedException, UnsupportedOperationException
      Throws:
      NoSuchElementException
      NotYetConnectedException
      UnsupportedOperationException
    • isSpecialMatrixSupported

      boolean isSpecialMatrixSupported(PlanePyramidSource.SpecialImageKind kind)
      Returns true if this special image kind is provided by current format.

      Default implementation in AbstractPlanePyramidSource return false.

      Parameters:
      kind - the kind of special image.
      Returns:
      whether this kind is supported; false by default.
    • readSpecialMatrix

      Optional<net.algart.arrays.Matrix<? extends net.algart.arrays.PArray>> readSpecialMatrix(PlanePyramidSource.SpecialImageKind kind) throws NotYetConnectedException
      Reads special image according specified kind.

      If the argument is PlanePyramidSource.SpecialImageKind.NONE, return null. In all other cases returns some non-null result.

      If there is no appropriate image, returns Optional.empty()..

      Parameters:
      kind - what special image is requested.
      Returns:
      special image or Optional.empty() if this kind is not supported.
      Throws:
      NotYetConnectedException
    • isDataReady

      boolean isDataReady()
      Returns true if the data at all available levels of this source are available. In other case, readSubMatrix(int, long, long, long, long) and readFullMatrix(int) method can throw NotYetConnectedException (but also, maybe, work properly),

      Note: all other methods, including dimensions(int), must work without NotYetConnectedException even if this method returns false.

      Returns:
      whether the data at all available levels of this source are available.
    • metadata

      default Optional<String> metadata()
      Returns some additional information about this pyramid or Optional.empty() if it is not supported. The returned string should be formatted according JSON standard.
      Returns:
      additional information about the pyramid or empty result.
    • loadResources

      void loadResources()
      Re-initializes object and loads all necessary resources.

      This method should be called before using this object, if freeResources(FlushMode) was called before. If you will not directly call this method, all will work normally, but some classes may work more slowly. For example, some classes may work with clones of this object, so, if it is not initialized, then all its clones will be also non-initialized and will be reinitialized while every usage.

    • freeResources

      void freeResources(PlanePyramidSource.FlushMode flushMode)