Interface SourceSampleConfigurer
SourceSampleConfigurer is used to define the source samples processed by a PointOperator.
The definition of a sample is given by its index within the pixel (a pixel comprises one or more samples) and
the name of a RasterDataNode in one of the source products.
Sample can also be computed on the fly, either by band maths expressions or by filters. See the various
#defineComputedSample(...) methods.
This interface is not intended to be implemented by clients.
- Since:
- SNAP 2.0
-
Method Summary
Modifier and TypeMethodDescriptionvoiddefineComputedSample(int index, int dataType, String expression, Product... sourceProducts) Defines an intermediate source sample computed from a band math expression.voiddefineComputedSample(int index, int sourceIndex, GeneralFilterBand.OpType opType, Kernel structuringElement) Defines an intermediate source sample computed from a non-linear image filter.voiddefineComputedSample(int index, int sourceIndex, Kernel kernel) Defines an intermediate source sample computed from a linear image convolution.voiddefineComputedSample(int index, RasterDataNode raster) Defines an intermediate source sample computed from the given raster.voiddefineSample(int index, String name) Defines a sample for aRasterDataNode.voiddefineSample(int index, String name, Product product) Defines a sample for aRasterDataNodein the given product.voidsetValidPixelMask(String maskExpression) Defines a mask that identifies valid pixels (region of interest) using a Boolean expression.
-
Method Details
-
setValidPixelMask
Defines a mask that identifies valid pixels (region of interest) using a Boolean expression. The framework evaluates the expression for each target pixel. If the mask evaluates to zero, all the target samples are set to their no-data values. Otherwise the respectivecomputePixelorcomputeSampleare called.- Parameters:
maskExpression- The Boolean valid-pixel mask expression.- See Also:
-
defineSample
Defines a sample for aRasterDataNode.- Parameters:
index- The index of the sample within the sample arrays passed tocomputeSample()orcomputePixel()methods.name- The name of aRasterDataNodeto which the sample belongs.
-
defineSample
Defines a sample for aRasterDataNodein the given product.- Parameters:
index- The index of the sample within the sample arrays passed tocomputeSample()orcomputePixel()methods.name- The name of aRasterDataNodeto which the sample belongs.product- The product in which to find the raster data node's name.
-
defineComputedSample
Defines an intermediate source sample computed from a band math expression.The method effectively creates a
VirtualBandfrom which it computes the source samples.If multiple source products are used a reference number
Product.setRefNo(int)has to be assigned.- Parameters:
index- The index of the sample within the sample arrays passed tocomputeSample()orcomputePixel()methods.dataType- The data type of the computed sample. SeeTYPE_Xconstants inProductData.expression- The band maths expression.sourceProducts- Source products that are referenced in the expression.
-
defineComputedSample
Defines an intermediate source sample computed from a linear image convolution.The method effectively creates a
ConvolutionFilterBandfrom which it computes the source samples.- Parameters:
index- The index of the sample within the sample arrays passed tocomputeSample()orcomputePixel()methods.sourceIndex- The index of the source sample that will be filtered.kernel- The image convolution kernel.
-
defineComputedSample
void defineComputedSample(int index, int sourceIndex, GeneralFilterBand.OpType opType, Kernel structuringElement) Defines an intermediate source sample computed from a non-linear image filter.The method effectively creates a
GeneralFilterBandfrom which it computes the source samples.- Parameters:
index- The index of the sample within the sample arrays passed tocomputeSample()orcomputePixel()methods.sourceIndex- The index of the source sample that will be filtered.opType- The filter operation to be applied to pixels identified by the structuring element.structuringElement- The structuring element is a Boolean kernel identifying the pixel positions to be filtered.
-
defineComputedSample
Defines an intermediate source sample computed from the given raster.The raster is usually either a component of the source products or not attached to any product at all. However, it must not be a component of the target product.
- Parameters:
index- The index of the sample within the sample arrays passed tocomputeSample()orcomputePixel()methods.raster- The index of the source sample that will be filtered.
-