docs: public static void equalizeLocalRow( GrayU16 input , int radius , int startY , GrayU16 output ,
  										 IWorkArrays workArrays ) {
  
  		int width = 2*radius+1;
  		int area = width*width;
  		int maxValue = workArrays.length()-1;
  		int[] histogram = workArrays.pop();
  		int[] transform = workArrays.pop();
  
  		// specify the top and bottom of the histogram window and make sure it is inside bounds
  		int hist0 = startY;
  		int hist1 = startY+width;
  		if( hist1 > input.height ) {
  			hist1 = input.height;
  			hist0 = hist1 - width;
  		}
  
  		// the upper and lower bounds of the region being equalized
  		int region0 = startY;
  		int region1 = startY+radius;
  
  		// local histogram and transformation
  		localHistogram(input,0,hist0,width,hist1,histogram);
  
  		int sum = 0;
  		for( int i = 0; i < histogram.length; i++ ) {
  			transform[i] = sum += histogram[i];
  		}
  
  		// equalize the first square region
  		for( int y = region0; y < region1; y++ ) {
  			int indexIn = input.startIndex + y*input.stride;
  			int indexOut = output.startIndex + y*output.stride;
  
  			for( int x = 0; x <= radius; x++ ) {
  				int inputValue =  input.data[indexIn++] & 0xff;
  				output.data[indexOut++] = (short)((transform[ inputValue ]*maxValue)/area);
  			}
  		}
  
  		// move right while equalizing the columns one at a time
  		for( int x = radius+1; x < input.width-radius-1; x++ ) {
  
  			// remove the left most column
  			int indexIn = input.startIndex + x-radius-1;
  			for( int y = hist0; y < hist1; y++ ) {
  				histogram[input.data[indexIn + y*input.stride] & 0xFFFF]--;
  			}
  			// add the right most column
  			indexIn += width;
  			for( int y = hist0; y < hist1; y++ ) {
  				histogram[input.data[indexIn + y*input.stride] & 0xFFFF]++;
  			}
  
  			// compute transformation table
  			sum = 0;
  			for( int i = 0; i < histogram.length; i++ ) {
  				transform[i] = sum += histogram[i];
  			}
  
  			// compute the output down the column
  			indexIn = input.startIndex + region0*input.stride + x;
  			int indexOut = output.startIndex + region0*output.stride + x;
  			for( int y = 0; y < radius; y++ ) {
  				int inputValue =  input.data[indexIn] & 0xff;
  				output.data[indexOut] = (short)((transform[ inputValue ]*maxValue)/area);
  
  				indexIn += input.stride;
  				indexOut += output.stride;
  			}
  		}
  
  		// equalize the final square region
  		localHistogram(input,input.width-width,hist0,input.width,hist1,histogram);
  
  		sum = 0;
  		for( int i = 0; i < histogram.length; i++ ) {
  			transform[i] = sum += histogram[i];
  		}
  
  		for( int y = region0; y < region1; y++ ) {
  			int x = input.width-radius-1;
  
  			int indexIn = input.startIndex + y*input.stride + x;
  			int indexOut = output.startIndex + y*output.stride + x;
  
  			for( ; x < input.width; x++ ) {
  				int inputValue =  input.data[indexIn++] & 0xff;
  				output.data[indexOut++] = (short)((transform[ inputValue ]*maxValue)/area);
  			}
  		}
  
  		workArrays.recycle(histogram);
  		workArrays.recycle(transform);
  	}