it.geosolutions.jaiext.stats
Class ComplexStatsOpImage

java.lang.Object
  extended by javax.media.jai.PlanarImage
      extended by javax.media.jai.OpImage
          extended by it.geosolutions.jaiext.stats.StatisticsOpImage
              extended by it.geosolutions.jaiext.stats.ComplexStatsOpImage
All Implemented Interfaces:
RenderedImage, javax.media.jai.ImageJAI, javax.media.jai.PropertyChangeEmitter, javax.media.jai.PropertySource, javax.media.jai.WritablePropertySource

public class ComplexStatsOpImage
extends StatisticsOpImage

The ComplexStatsOpImage class performs various comples statistics operations on an image. The statistical operation are indicated by the Statistics.StatsType class. A comples operation is an operation which stores the pixel values into an array. These operations can be calculated together by adding entries in the definition array "statsTypes". A ROI object passed to the constructor is taken into account by counting only the samples inside of it; an eventual No Data Range is considered by counting only values that are not No Data. The statistical calculation is performed by calling the getProperty() method. The statistics are calculated for every image tile but the results are saved into only one global container. For avoiding to compromise the thread-safety of the class, every statistics object should handle concurrent threads. At the end of the calculation the statistics container is passed to the getProperty() method as a Result. For avoiding unnecessary operations the statistics can be calculated only the first time; but if the user needs to re-calculate the statistics, they can be cleared with the clearStatistic() method and then returned by calling again the getProperty() method.


Field Summary
 
Fields inherited from class it.geosolutions.jaiext.stats.StatisticsOpImage
bands, bandsNumber, booleanLookupTable, caseA, caseB, caseC, firstTime, hasNoData, hasROI, noData, ROI_EXTENDER, roiBounds, roiIter, selectedBands, srcROIImage, statNum, stats, statsTypes, useROIAccessor, xPeriod, yPeriod
 
Fields inherited from class javax.media.jai.OpImage
cache, cobbleSources, OP_COMPUTE_BOUND, OP_IO_BOUND, OP_NETWORK_BOUND, tileCacheMetric, tileRecycler
 
Fields inherited from class javax.media.jai.PlanarImage
colorModel, eventManager, height, minX, minY, properties, sampleModel, tileFactory, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width
 
Constructor Summary
ComplexStatsOpImage(RenderedImage source, javax.media.jai.ImageLayout layout, Map configuration, int xPeriod, int yPeriod, javax.media.jai.ROI roi, Range noData, boolean useROIAccessor, int[] bands, Statistics.StatsType[] statsTypes, double[] minBound, double[] maxBound, int[] numBins)
           
 
Method Summary
 Raster computeTile(int tileX, int tileY)
          Returns a tile for reading.
 
Methods inherited from class it.geosolutions.jaiext.stats.StatisticsOpImage
byteLoop, clearStatistic, dispose, doubleLoop, floatLoop, getProperty, getPropertyNames, getTiles, intLoop, mapDestRect, mapSourceRect, shortLoop, ushortLoop
 
Methods inherited from class javax.media.jai.OpImage
addTileToCache, cancelTiles, computeRect, computeRect, computesUniqueTiles, createTile, getExpandedNumBands, getFormatTags, getOperationComputeType, getTile, getTileCache, getTileCacheMetric, getTileDependencies, getTileFromCache, getTileRecycler, getTiles, hasExtender, mapDestPoint, mapSourcePoint, prefetchTiles, queueTiles, recycleTile, setTileCache, vectorize, vectorize, vectorize
 
Methods inherited from class javax.media.jai.PlanarImage
addPropertyChangeListener, addPropertyChangeListener, addSink, addSink, addSource, addTileComputationListener, copyData, copyData, copyExtendedData, createColorModel, createSnapshot, createWritableRaster, finalize, getAsBufferedImage, getAsBufferedImage, getBounds, getColorModel, getData, getData, getDefaultColorModel, getExtendedData, getGraphics, getHeight, getImageID, getMaxTileX, getMaxTileY, getMaxX, getMaxY, getMinTileX, getMinTileY, getMinX, getMinY, getNumBands, getNumSources, getNumXTiles, getNumYTiles, getProperties, getPropertyClass, getPropertyNames, getSampleModel, getSinks, getSource, getSourceImage, getSourceObject, getSources, getSplits, getTileComputationListeners, getTileFactory, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileIndices, getTileRect, getTileWidth, getWidth, overlapsMultipleTiles, removeProperty, removePropertyChangeListener, removePropertyChangeListener, removeSink, removeSink, removeSinks, removeSource, removeSources, removeTileComputationListener, setImageLayout, setProperties, setProperty, setSource, setSources, tileXToX, tileXToX, tileYToY, tileYToY, toString, wrapRenderedImage, XToTileX, XToTileX, YToTileY, YToTileY
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComplexStatsOpImage

public ComplexStatsOpImage(RenderedImage source,
                           javax.media.jai.ImageLayout layout,
                           Map configuration,
                           int xPeriod,
                           int yPeriod,
                           javax.media.jai.ROI roi,
                           Range noData,
                           boolean useROIAccessor,
                           int[] bands,
                           Statistics.StatsType[] statsTypes,
                           double[] minBound,
                           double[] maxBound,
                           int[] numBins)
Method Detail

computeTile

public Raster computeTile(int tileX,
                          int tileY)
Returns a tile for reading.

Overrides:
computeTile in class javax.media.jai.OpImage
Parameters:
tileX - The X index of the tile.
tileY - The Y index of the tile.
Returns:
The tile as a Raster.


Copyright © 2006–2014 GeoSolutions. All rights reserved.