docs: public static <T extends ImageGray<T>>
  	InputToBinary<T> threshold( ConfigThreshold config, Class<T> inputType) {
  
  		switch( config.type ) {
  			case FIXED:
  				return globalFixed(config.fixedThreshold, config.down, inputType);
  
  			case GLOBAL_OTSU:
  				return globalOtsu(config.minPixelValue, config.maxPixelValue, config.scale, config.down, inputType);
  
  			case GLOBAL_ENTROPY:
  				return globalEntropy(config.minPixelValue, config.maxPixelValue, config.scale, config.down, inputType);
  
  			case GLOBAL_LI:
  				return globalLi(config.minPixelValue, config.maxPixelValue, config.scale, config.down, inputType);
  
  			case GLOBAL_HUANG:
  				return globalHuang(config.minPixelValue, config.maxPixelValue, config.scale, config.down, inputType);
  
  			case LOCAL_GAUSSIAN:
  				return localGaussian(config.width, config.scale, config.down, inputType);
  
  			case LOCAL_SAVOLA:
  				return localSauvola(config.width, config.down, config.savolaK, inputType);
  
  			case LOCAL_NICK:
  				return localNick(config.width, config.down, config.nickK, inputType);
  
  			case LOCAL_MEAN:
  				return localMean(config.width, config.scale, config.down, inputType);
  
  			case LOCAL_OTSU: {
  				ConfigThresholdLocalOtsu c = (ConfigThresholdLocalOtsu) config;
  				return localOtsu(config.width, config.scale, config.down, c.useOtsu2, c.tuning, inputType);
  			}
  
  			case BLOCK_MIN_MAX: {
  				ConfigThresholdBlockMinMax c = (ConfigThresholdBlockMinMax) config;
  				return blockMinMax(c.width, c.scale , c.down, c.thresholdFromLocalBlocks, c.minimumSpread,
  						inputType);
  			}
  
  			case BLOCK_MEAN:
  				return blockMean(config.width, config.scale , config.down,
  						config.thresholdFromLocalBlocks, inputType);
  
  			case BLOCK_OTSU: {
  				ConfigThresholdLocalOtsu c = (ConfigThresholdLocalOtsu) config;
  				return blockOtsu(c.width, c.scale, c.down, c.thresholdFromLocalBlocks, c.useOtsu2, c.tuning,
  						inputType);
  			}
  
  		}
  		throw new IllegalArgumentException("Unknown type "+config.type);
  	}