code: public static <I extends ImageMultiBand<I>, M extends ImageMultiBand<M>, D extends ImageGray<D>>
  	ImageGradient<I,D> gradientReduce( ImageGradient<I,M> gradient ,
  									   DerivativeReduceType type,
  									   Class<D> outputType )
  	{
  
  		String name;
  
  		switch( type ) {
  			case MAX_F: name = "maxf"; break;
  			default:
  				throw new RuntimeException("Unknown reduce type "+type);
  		}
  
  		Class middleType;
  		switch( gradient.getDerivativeType().getFamily()) {
  			case PLANAR:
  				middleType = Planar.class;
  				break;
  
  			case GRAY:
  				throw new IllegalArgumentException("Can't have gradient output be single band");
  
  			default:
  				middleType = gradient.getDerivativeType().getImageClass();
  		}
  
  
  		Method m = findReduce(name,middleType, outputType);
  		GradientMultiToSingleBand_Reflection<M,D> reducer =
  				new GradientMultiToSingleBand_Reflection<>(m, gradient.getDerivativeType(), outputType);
  
  		return new ImageGradientThenReduce<>(gradient, reducer);
  	}
docs: Computes the image gradient inside a multi-band image then reduces the output to a single
  band before returning the results
  
  @param gradient Computes the multi-band image gradient
  @param type Specifies which method is to be used to reduce the output into single band image
  @param outputType Type of output image
  @param <I> Input type
  @param <M> Intermediate type
  @param <D> Output type
  @return Gradient