Class CombinedPlanePyramidSource
- All Implemented Interfaces:
PlanePyramidSource
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.algart.matrices.maps.pyramids.io.api.PlanePyramidSource
PlanePyramidSource.AveragingMode, PlanePyramidSource.FlushMode, PlanePyramidSource.SpecialImageKind -
Field Summary
Fields inherited from interface net.algart.matrices.maps.pyramids.io.api.PlanePyramidSource
DEFAULT_COMPRESSION, DEFAULT_MINIMAL_PYRAMID_SIZE, DEFAULT_TILE_DIM, DIM_BAND, DIM_HEIGHT, DIM_WIDTH -
Method Summary
Modifier and TypeMethodDescriptionintintlong[]dimensions(int resolutionLevel) Returns dimensions of any pyramid level.Class<?>voidfreeResources(PlanePyramidSource.FlushMode flushMode) boolean[]booleanReturns true if the data at all available levels of this source are available.booleanReturns true ifPlanePyramidSource.elementType()method works properly.booleanbooleanisResolutionLevelAvailable(int resolutionLevel) booleanReturns true if this special image kind is provided by current format.voidRe-initializes object and loads all necessary resources.metadata()Returns some additional information about this pyramid orOptional.empty()if it is not supported.static PlanePyramidSourcenewInstance(PlanePyramidSource mainParent, PlanePyramidSource overridingParent) intnet.algart.arrays.Matrix<? extends net.algart.arrays.PArray>readFullMatrix(int resolutionLevel) Optional<net.algart.arrays.Matrix<? extends net.algart.arrays.PArray>>Reads special image according specified kind.net.algart.arrays.Matrix<? extends net.algart.arrays.PArray>readSubMatrix(int resolutionLevel, long fromX, long fromY, long toX, long toY) 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.List<net.algart.math.IRectangularArea>Returns a set of all areas, which are 2D rectangles, filled by actual data, at the zero level.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.algart.matrices.maps.pyramids.io.api.PlanePyramidSource
dim, height, width
-
Method Details
-
newInstance
public static PlanePyramidSource newInstance(PlanePyramidSource mainParent, PlanePyramidSource overridingParent) -
numberOfResolutions
public int numberOfResolutions()- Specified by:
numberOfResolutionsin interfacePlanePyramidSource
-
compression
public int compression()- Specified by:
compressionin interfacePlanePyramidSource
-
bandCount
public int bandCount()- Specified by:
bandCountin interfacePlanePyramidSource
-
isResolutionLevelAvailable
public boolean isResolutionLevelAvailable(int resolutionLevel) - Specified by:
isResolutionLevelAvailablein interfacePlanePyramidSource
-
getResolutionLevelsAvailability
public boolean[] getResolutionLevelsAvailability()- Specified by:
getResolutionLevelsAvailabilityin interfacePlanePyramidSource
-
dimensions
public long[] dimensions(int resolutionLevel) Description copied from interface:PlanePyramidSourceReturns dimensions of any pyramid level. Number of elements in the result arrays is always 3:
- first element result[0] is always equal to
PlanePyramidSource.bandCount(); - the element result[
PlanePyramidSource.DIM_WIDTH] is the x-dimension of the level in pixels; - the element result[
PlanePyramidSource.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.
- Specified by:
dimensionsin interfacePlanePyramidSource- Parameters:
resolutionLevel- the level of pyramid; zero level (resolutionLevel=0) corresponds to the best resolution.- Returns:
- dimensions of the specified pyramid level.
- first element result[0] is always equal to
-
isElementTypeSupported
public boolean isElementTypeSupported()Description copied from interface:PlanePyramidSourceReturns true ifPlanePyramidSource.elementType()method works properly. In other case, that method throws UnsupportedOperationException. In particular, returns true inDefaultPlanePyramidSource.- Specified by:
isElementTypeSupportedin interfacePlanePyramidSource- Returns:
- whether
PlanePyramidSource.elementType()is supported.
-
elementType
- Specified by:
elementTypein interfacePlanePyramidSource- Throws:
UnsupportedOperationException
-
pixelSizeInMicrons
- Specified by:
pixelSizeInMicronsin interfacePlanePyramidSource
-
magnification
- Specified by:
magnificationin interfacePlanePyramidSource
-
zeroLevelActualRectangles
Description copied from interface:PlanePyramidSourceReturns 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)[PlanePyramidSource.DIM_WIDTH]−1,dimensions(0)[PlanePyramidSource.DIM_HEIGHT]−1).- Specified by:
zeroLevelActualRectanglesin interfacePlanePyramidSource- Returns:
- a list of all areas (2D rectangles), filled by actual data, at the level #0, or null if it is not supported.
-
zeroLevelActualAreaBoundaries
Description copied from interface:PlanePyramidSourceReturns 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
AbstractPlanePyramidSourcecallsPlanePyramidSource.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. IfPlanePyramidSource.zeroLevelActualRectangles()returns null, the default implementation also returns null.- Specified by:
zeroLevelActualAreaBoundariesin interfacePlanePyramidSource- 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
public net.algart.arrays.Matrix<? extends net.algart.arrays.PArray> readSubMatrix(int resolutionLevel, long fromX, long fromY, long toX, long toY) - Specified by:
readSubMatrixin interfacePlanePyramidSource
-
isFullMatrixSupported
public boolean isFullMatrixSupported()- Specified by:
isFullMatrixSupportedin interfacePlanePyramidSource
-
readFullMatrix
public net.algart.arrays.Matrix<? extends net.algart.arrays.PArray> readFullMatrix(int resolutionLevel) throws UnsupportedOperationException - Specified by:
readFullMatrixin interfacePlanePyramidSource- Throws:
UnsupportedOperationException
-
isSpecialMatrixSupported
Description copied from interface:PlanePyramidSourceReturns true if this special image kind is provided by current format.Default implementation in AbstractPlanePyramidSource return false.
- Specified by:
isSpecialMatrixSupportedin interfacePlanePyramidSource- Parameters:
kind- the kind of special image.- Returns:
- whether this kind is supported; false by default.
-
readSpecialMatrix
public Optional<net.algart.arrays.Matrix<? extends net.algart.arrays.PArray>> readSpecialMatrix(PlanePyramidSource.SpecialImageKind kind) throws NotYetConnectedException Description copied from interface:PlanePyramidSourceReads 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()..- Specified by:
readSpecialMatrixin interfacePlanePyramidSource- Parameters:
kind- what special image is requested.- Returns:
- special image or
Optional.empty()if this kind is not supported. - Throws:
NotYetConnectedException
-
isDataReady
public boolean isDataReady()Description copied from interface:PlanePyramidSourceReturns true if the data at all available levels of this source are available. In other case,PlanePyramidSource.readSubMatrix(int, long, long, long, long)andPlanePyramidSource.readFullMatrix(int)method can throw NotYetConnectedException (but also, maybe, work properly),Note: all other methods, including
PlanePyramidSource.dimensions(int), must work without NotYetConnectedException even if this method returns false.- Specified by:
isDataReadyin interfacePlanePyramidSource- Returns:
- whether the data at all available levels of this source are available.
-
metadata
Description copied from interface:PlanePyramidSourceReturns some additional information about this pyramid orOptional.empty()if it is not supported. The returned string should be formatted according JSON standard.- Specified by:
metadatain interfacePlanePyramidSource- Returns:
- additional information about the pyramid or empty result.
-
loadResources
public void loadResources()Description copied from interface:PlanePyramidSourceRe-initializes object and loads all necessary resources.This method should be called before using this object, if
PlanePyramidSource.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.- Specified by:
loadResourcesin interfacePlanePyramidSource
-
freeResources
- Specified by:
freeResourcesin interfacePlanePyramidSource
-