docs: protected void trace( int x , int y , int indexInten ) {
  
  		int dx,dy;
  
  		int indexOut = output.getIndex(x,y);
  		open.grow().set(x,y);
  		output.data[indexOut] = 1;
  		intensity.data[ indexInten ] = MARK_TRAVERSED;
  
  		while( open.size() > 0 ) {
  			active.set(open.removeTail());
  			indexInten = intensity.getIndex(active.x,active.y);
  			int indexDir = direction.getIndex(active.x,active.y);
  
  			boolean first = true;
  
  			while( true ) {
  				//----- First check along the direction of the edge.  Only need to check 2 points this way
  				switch( direction.data[ indexDir ] ) {
  					case  0: dx =  0;dy=  1; break;
  					case  1: dx =  1;dy= -1; break;
  					case  2: dx =  1;dy=  0; break;
  					case -1: dx =  1;dy=  1; break;
  					default: throw new RuntimeException("Unknown direction: "+direction.data[ indexDir ]);
  				}
  
  				int indexForward = indexInten + dy*intensity.stride + dx;
  				int indexBackward = indexInten - dy*intensity.stride - dx;
  
  				int prevIndexDir = indexDir;
  
  				boolean match = false;
  
  				// pixel coordinate of forward and backward point
  				x = active.x; y = active.y;
  				int fx = active.x+dx, fy = active.y+dy;
  				int bx = active.x-dx, by = active.y-dy;
  
  				if( intensity.isInBounds(fx,fy) && intensity.data[ indexForward ] >= lower ) {
  					intensity.data[ indexForward ] = MARK_TRAVERSED;
  					output.unsafe_set(fx, fy, 1);
  					active.set(fx, fy);
  					match = true;
  					indexInten = indexForward;
  					indexDir = prevIndexDir  + dy*intensity.stride + dx;
  				}
  				if( intensity.isInBounds(bx,by) && intensity.data[ indexBackward ] >= lower ) {
  					intensity.data[ indexBackward ] = MARK_TRAVERSED;
  					output.unsafe_set(bx,by,1);
  					if( match ) {
  						open.grow().set(bx,by);
  					} else {
  						active.set(bx,by);
  						match = true;
  						indexInten = indexBackward;
  						indexDir = prevIndexDir  - dy*intensity.stride - dx;
  					}
  				}
  
  				if( first || !match ) {
  					boolean priorMatch = match;
  					// Check local neighbors if its one of the end points, which would be the first point or
  					// any point for which no matches were found
  					match = checkAllNeighbors(x,y,match);
  
  					if( !match )
  						break;
  					else {
  						// if it was the first it's no longer the first
  						first = false;
  
  						// the point at the end was just added and is to be searched in the next iteration
  						if( !priorMatch ) {
  							indexInten = intensity.getIndex(active.x, active.y);
  							indexDir = direction.getIndex(active.x,active.y);
  						}
  					}
  				}
  			}
  		}
  	}