Spatial morphological Binary Propagation filter
Spatial morphological Binary Propagation filter.
Spatial morphological Binary Propagation filter performs multi-dimensional binary propagation with a given structuring element, spreading the influence of 1 pixels in a binary image to neighboring pixels based on a predefined connectivity criterion.
When applying this algorithm to continous image data, the input will be binarised.
Usage:
Start the algorithm from the Processing Toolbox panel.
Select the raster to process and modify the parameterization if necessary, then click run.
Processed image in comparison to the original.
Parameters
- Raster layer [raster]
Raster layer to be processed band-wise.
- Function [string]
Python code. See binary_closing, generate_binary_structure, iterate_structure for information on different parameters. Default:
from scipy.ndimage import binary_propagation, generate_binary_structure, iterate_structure structure = generate_binary_structure\(rank=2, connectivity=1\) structure = iterate_structure\(structure=structure, iterations=1\) function = lambda array: binary_propagation\(array, structure=structure\)
Outputs
- Output raster layer [rasterDestination]
Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMorphologicalBinaryPropagationFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage import binary_propagation, generate_binary_structure, iterate_structure
structure = generate_binary_structure(rank=2, connectivity=1)
structure = iterate_structure(structure=structure, iterations=1)
function = lambda array: binary_propagation(array, structure=structure)
Argument type: string
Acceptable values:
- String value
- field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field
- expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer