org.jaitools.media.jai.kernelstats
Class KernelStatsOpImage

java.lang.Object
  extended by javax.media.jai.PlanarImage
      extended by javax.media.jai.OpImage
          extended by javax.media.jai.AreaOpImage
              extended by org.jaitools.media.jai.kernelstats.KernelStatsOpImage
All Implemented Interfaces:
RenderedImage, javax.media.jai.ImageJAI, javax.media.jai.PropertyChangeEmitter, javax.media.jai.PropertySource, javax.media.jai.WritablePropertySource

public class KernelStatsOpImage
extends javax.media.jai.AreaOpImage

An operator to calculate neighbourhood statistics on a source image.

Since:
1.0
Version:
$Id$
Author:
Michael Bedward
See Also:
Description of the algorithm and example

Field Summary
 
Fields inherited from class javax.media.jai.AreaOpImage
bottomPadding, extender, leftPadding, rightPadding, topPadding
 
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
KernelStatsOpImage(RenderedImage source, javax.media.jai.BorderExtender extender, Map config, javax.media.jai.ImageLayout layout, Statistic[] stats, javax.media.jai.KernelJAI kernel, int band, javax.media.jai.ROI roi, boolean maskSrc, boolean maskDest, boolean ignoreNaN, Number nilValue)
          Creates a new instance.
 
Method Summary
protected  void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect)
          Calculates neighbourhood statistics for a specified rectangle
 
Methods inherited from class javax.media.jai.AreaOpImage
computeTile, getBorderExtender, getBottomPadding, getLeftPadding, getRightPadding, getTopPadding, mapDestRect, mapSourceRect
 
Methods inherited from class javax.media.jai.OpImage
addTileToCache, cancelTiles, computeRect, computesUniqueTiles, createTile, dispose, 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, getProperty, getPropertyClass, getPropertyNames, getPropertyNames, getSampleModel, getSinks, getSource, getSourceImage, getSourceObject, getSources, getSplits, getTileComputationListeners, getTileFactory, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileIndices, getTileRect, getTiles, 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

KernelStatsOpImage

public KernelStatsOpImage(RenderedImage source,
                          javax.media.jai.BorderExtender extender,
                          Map config,
                          javax.media.jai.ImageLayout layout,
                          Statistic[] stats,
                          javax.media.jai.KernelJAI kernel,
                          int band,
                          javax.media.jai.ROI roi,
                          boolean maskSrc,
                          boolean maskDest,
                          boolean ignoreNaN,
                          Number nilValue)
Creates a new instance.

Parameters:
source - the source image
extender - an optional BorderExtender or null
config - configurable attributes of the image (see AreaOpImage)
layout - an optional ImageLayout object; if the layout specifies a SampleModel and / or ColorModel that are invalid for the requested statistics (e.g. wrong number of bands) these will be overridden
stats - an array of Statistic constants
kernel - the convolution kernel
band - the source image band to process
roi - an optional ROI or null
ignoreNaN - if true NaN values are ignored; otherwise any NaN values in a pixels neighbourhood cause nilValue to be returned
maskSrc - if true only neighbourhood pixels within the ROI are used in calculations
maskDest - if true, nilValue is returned for any pixels outside the ROI
nilValue - value to return for pixels with no result
Throws:
IllegalArgumentException - if the ROI's bounds do not contain the entire source image
See Also:
KernelStatsDescriptor, Statistic
Method Detail

computeRect

protected void computeRect(Raster[] sources,
                           WritableRaster dest,
                           Rectangle destRect)
Calculates neighbourhood statistics for a specified rectangle

Overrides:
computeRect in class javax.media.jai.OpImage
Parameters:
sources - source rasters (only sources[0] is used here)
dest - a WritableRaster tile containing the area to be computed.
destRect - the rectangle within dest to be processed.


Copyright © 2009-2013. All Rights Reserved.