code: public static GrayU8 thin(GrayU8 input , int maxIterations, GrayU8 output ) {
  
  		output = InputSanityCheck.checkDeclare(input, output);
  
  		output.setTo(input);
  		BinaryThinning thinning = new BinaryThinning();
  
  		thinning.apply(output,maxIterations);
  
  		return output;
  	}
docs: Applies a morphological thinning operation to the image.  Also known as skeletonization.
  
  @see BinaryThinning
  
  @param input Input image.  Not modified.
  @param maxIterations Maximum number of cycles it will thin for.  -1 for the maximum required
  @param output If not null, the output image.  If null a new image is declared and returned.  Modified.
  @return Output image.