How can I find for every point, which one of its 8 surrounding points (not only out of the 4 neighbours)(pic.2) 
has the maximum value of  an attribute ? 
I want to create a vector at each point that points to the direction that the attribute increases(pic.1) 
I believe this is called Attibute Gradient. 
I want to achieve that in VOPS. I have made some progress but something is not right.(pic.3) 
I know for sure that one of my mistakes, is that when ask from pcopen the 8 closest points, one of them is the lookup point itself.. 
How do I exclude it? 
Any help or idea is more than welcome!!! 
 
 
 
Attribute Gradient 1.hipnc