Class ExtendingPlanePyramidSource
- All Implemented Interfaces:
PlanePyramidSource
-
Nested Class Summary
Nested classes/interfaces inherited from class net.algart.matrices.maps.pyramids.io.api.AbstractPlanePyramidSource
AbstractPlanePyramidSource.LabelPosition, AbstractPlanePyramidSource.TileDirection, AbstractPlanePyramidSource.WholeSlideScalerNested 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 TypeMethodDescriptionintintlongdim(int resolutionLevel, int index) Returns the dimension #index of the given pyramid level.long[]dimensions(int resolutionLevel) Returns dimensions of any pyramid level.Class<?>voidfreeResources(PlanePyramidSource.FlushMode flushMode) This implementation frees the tile cache.longlongintlonglongboolean[]booleanReturns true if the data at all available levels of this source are available.booleanReturns true ifPlanePyramidSource.elementType()method works properly.booleanisResolutionLevelAvailable(int resolutionLevel) booleanReturns true if this special image kind is provided by current format.voidThis implementation does nothing.metadata()Returns some additional information about this pyramid orOptional.empty()if it is not supported.static ExtendingPlanePyramidSourcenewInstance(PlanePyramidSource parent, long extendedDimX, long extendedDimY, long positionXInExtendedMatrix, long positionYInExtendedMatrix, double[] backgroundColor) intparent()protected net.algart.arrays.Matrix<? extends net.algart.arrays.PArray>readLittleSubMatrix(int resolutionLevel, long fromX, long fromY, long toX, long toY) Optional<net.algart.arrays.Matrix<? extends net.algart.arrays.PArray>>Reads special image according specified kind.voidsetExtendingBorderColor(Color extendingBorderColor) voidsetExtendingBorderWidth(int extendingBorderWidth) 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 net.algart.matrices.maps.pyramids.io.api.AbstractPlanePyramidSource
checkSubMatrixRanges, checkSubMatrixRanges, constantMatrixSkippingFiller, defaultZeroLevelActualRectangles, disableTileCaching, enableTileCaching, fillBySkippingFiller, getLabelRotation, getLabelRotationBackground, getMemoryModel, getSkippingFiller, getTileCacheDirection, getTileCachingMemory, isSkipCoarseData, isTileCachingEnabled, makeWholeSlideFromLabelAndMap, newFilledResultMatrix, newResultMatrix, readFullMatrix, readingTileDim, readSubMatrix, setLabelRotation, setLabelRotationBackground, setMemoryModel, setSkipCoarseData, setSkippingFiller, setTileCachingMemory, wholeSlideDimXMethods 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
height, isFullMatrixSupported, readFullMatrix, readSubMatrix, width
-
Method Details
-
newInstance
public static ExtendingPlanePyramidSource newInstance(PlanePyramidSource parent, long extendedDimX, long extendedDimY, long positionXInExtendedMatrix, long positionYInExtendedMatrix, double[] backgroundColor) -
parent
-
getExtendedDimX
public long getExtendedDimX() -
getExtendedDimY
public long getExtendedDimY() -
getPositionXInExtendedMatrix
public long getPositionXInExtendedMatrix() -
getPositionYInExtendedMatrix
public long getPositionYInExtendedMatrix() -
getExtendingBorderWidth
public int getExtendingBorderWidth() -
setExtendingBorderWidth
public void setExtendingBorderWidth(int extendingBorderWidth) -
getExtendingBorderColor
-
setExtendingBorderColor
-
numberOfResolutions
public int numberOfResolutions()- Specified by:
numberOfResolutionsin interfacePlanePyramidSource- Specified by:
numberOfResolutionsin classAbstractPlanePyramidSource
-
compression
public int compression()- Specified by:
compressionin interfacePlanePyramidSource- Overrides:
compressionin classAbstractPlanePyramidSource
-
bandCount
public int bandCount()- Specified by:
bandCountin interfacePlanePyramidSource- Specified by:
bandCountin classAbstractPlanePyramidSource
-
isResolutionLevelAvailable
public boolean isResolutionLevelAvailable(int resolutionLevel) - Specified by:
isResolutionLevelAvailablein interfacePlanePyramidSource- Overrides:
isResolutionLevelAvailablein classAbstractPlanePyramidSource
-
getResolutionLevelsAvailability
public boolean[] getResolutionLevelsAvailability()- Specified by:
getResolutionLevelsAvailabilityin interfacePlanePyramidSource- Overrides:
getResolutionLevelsAvailabilityin classAbstractPlanePyramidSource
-
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- Specified by:
dimensionsin classAbstractPlanePyramidSource- 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
-
dim
public long dim(int resolutionLevel, int index) Description copied from interface:PlanePyramidSourceReturns the dimension #index of the given pyramid level. Equivalent todimensions(resolutionLevel)[index], but works faster.- Specified by:
dimin interfacePlanePyramidSource- Specified by:
dimin classAbstractPlanePyramidSourceindex- the index of dimension.- Returns:
- the dimension #index of this level.
-
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- Overrides:
isElementTypeSupportedin classAbstractPlanePyramidSource- Returns:
- whether
PlanePyramidSource.elementType()is supported.
-
elementType
- Specified by:
elementTypein interfacePlanePyramidSource- Overrides:
elementTypein classAbstractPlanePyramidSource- 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- Overrides:
zeroLevelActualAreaBoundariesin classAbstractPlanePyramidSource- 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.
-
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- Overrides:
isSpecialMatrixSupportedin classAbstractPlanePyramidSource- 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- Overrides:
readSpecialMatrixin classAbstractPlanePyramidSource- 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- Overrides:
isDataReadyin classAbstractPlanePyramidSource- 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 class:AbstractPlanePyramidSourceThis implementation does nothing.If your implementation overrides this method, it must call super.loadResources at the end — because it is possible that future version will do something useful.
- Specified by:
loadResourcesin interfacePlanePyramidSource- Overrides:
loadResourcesin classAbstractPlanePyramidSource
-
freeResources
Description copied from class:AbstractPlanePyramidSourceThis implementation frees the tile cache.- Specified by:
freeResourcesin interfacePlanePyramidSource- Overrides:
freeResourcesin classAbstractPlanePyramidSource- Parameters:
flushMode- possible strategy of freeing resources (ignored by this implementation).
-
readLittleSubMatrix
protected net.algart.arrays.Matrix<? extends net.algart.arrays.PArray> readLittleSubMatrix(int resolutionLevel, long fromX, long fromY, long toX, long toY) throws NoSuchElementException, NotYetConnectedException - Specified by:
readLittleSubMatrixin classAbstractPlanePyramidSource- Throws:
NoSuchElementExceptionNotYetConnectedException
-