Showing results for 
Search instead for 
Do you mean 

Calling a Model from within a Model

by on ‎12-04-2015 11:46 AM - edited on ‎02-21-2020 09:02 AM by Community Manager (758 Views)

Download models


Applies a directional 5x5 convolution smoothing filter. This technique smooths small regions while preserving significant edges. The model implementation consists of a simple primary model calling another external model via the Spatial Model operator.


Input image and directionally smoothed output image


The directional smoothing technique uses 8 different 5x5 convolution filters representing 8 directional neighborhoods (north, northeast, etc).  A focal standard deviation is calculated for each neighborhood,  Then a convolution is selected for the neighborhood that has the least amount of variability.  This technique is useful for image generalization.


The implementation of this model illustrates use of the Spatial Model operator.  This operator enables models to call other models.  The primary model stores the full path and file name of the model it is calling.  If it cannot find the model, it tries to locate the model in the same directory as the primary model. Effectively this enables Spatial Models to be re-used as if they were Operators.



ApplyDirectionalSmoothing-v15-1-1.gmdx - the Primary Model


DirectionalSmoothing-v15-1-1.gmdx - the Model Called by the Primary Model


Input parameters:


Image In: Name of the input image to be smoothed.

Image Out: Name of the output image file created by the smoothing.