Class Histogram
- All Implemented Interfaces:
Serializable,Operation
For the moment this is a very simple wrap. Plans on the 2.4 and successive versions of this operation are to add
the ability to use spatial ROIs and to specific Spatial subsampling. As of now, ROI has to be a Java2D Shape
subclass and the parameters to control x and y subsamplings got to be Integer, which means pixel-aware.
For more information on how the underlying JAI operators works you can have a look here: HistogramDescriptor
<a href="http://download.java.net/media/jai/javadoc/1.1.3/jai-apidocs/javax/media/jai/Histogram.html>Histogram
How to use this operation Here is a very simple example on how to use this operation in order to
get the Histogram of the source coverage.
final OperationJAI op=new OperationJAI("Histogram");
ParameterValueGroup params = op.getParameters();
params.parameter("Source").setValue(coverage);
coverage=(GridCoverage2D) op.doOperation(params,null);
System.out.println(((double[])coverage.getProperty("histogram")));
- Since:
- 2.4
- Author:
- Simone Giannecchini
- See Also:
-
Histogram- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class OperationJAI
OperationJAI.Parameters -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringStringkey for getting theHistogramobject.Fields inherited from class BaseStatisticsOperationJAI
LOGGER, ROI, SPATIAL_SUBSAMPLING_X, SPATIAL_SUBSAMPLING_YFields inherited from class OperationJAI
operation, RENDERED_MODEFields inherited from class Operation2D
PRIMARY_SOURCE_INDEX, SOURCE_0Fields inherited from class AbstractOperation
descriptor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()Returns the name of the processing operation.getProperties(RenderedImage data, CoordinateReferenceSystem crs, InternationalString name, MathTransform toCRS, GridCoverage2D[] sources, OperationJAI.Parameters parameters) Prepare theHistogramproperty for this histogram operation.protected ParameterBlockImageNprepareParameters(ParameterValueGroup parameters) Copies parameter values from the specifiedParameterValueGroupto theParameterBlockImageNMethods inherited from class BaseStatisticsOperationJAI
convertPolygonMethods inherited from class OperationJAI
createRenderedImage, deriveCategory, deriveGridCoverage, deriveName, deriveRange, deriveSampleDimension, deriveUnit, doOperation, equals, extractSources, getJAI, getOperationDescriptor, getQuantitative, handleJAIEXTParams, handleROINoDataInternal, handleROINoDataProperties, hashCode, resampleToCommonGeometryMethods inherited from class Operation2D
extractSources, getFactoryMethods inherited from class AbstractOperation
getDescription, getDocURL, getNumSources, getParameters, getVendor, getVersion, toString
-
Field Details
-
GT_SYNTHETIC_PROPERTY_HISTOGRAM
Stringkey for getting theHistogramobject.- See Also:
-
-
Constructor Details
-
Histogram
Default constructor for theHistogramoperation.- Throws:
OperationNotFoundException
-
-
Method Details
-
getName
Description copied from class:AbstractOperationReturns the name of the processing operation. The default implementation returns the AbstractOperation.descriptor code name.- Specified by:
getNamein interfaceOperation- Overrides:
getNamein classAbstractOperation- Returns:
- The name of the processing operation.
-
getProperties
protected Map<String,?> getProperties(RenderedImage data, CoordinateReferenceSystem crs, InternationalString name, MathTransform toCRS, GridCoverage2D[] sources, OperationJAI.Parameters parameters) Prepare theHistogramproperty for this histogram operation.- Overrides:
getPropertiesin classOperationJAI- Parameters:
data- TheRenderedImagecreated by this operation.crs- The coordinate reference system assigned to the coverage thisOperationJAIwill produce.name- The name assigned to the coverage thisOperationJAIwill produce.toCRS- The transform from grid tocrsto be assigned to the coverage thisOperationJAIwill produce.sources- The sources to be assigned to the coverage thisOperationJAIwill produce.parameters- The parameters that were used by thisOperationJAI.- Returns:
- a
Mapwith the properties generated by thisOperationJAIor null if we haven't any.
-
prepareParameters
Description copied from class:BaseStatisticsOperationJAICopies parameter values from the specifiedParameterValueGroupto theParameterBlockImageN- Overrides:
prepareParametersin classBaseStatisticsOperationJAI- Parameters:
parameters- TheParameterValueGroupto be copied.- Returns:
- A copy of the provided
ParameterValueGroupas a ImageN block. - See Also:
-