def run(self,ip):
        """@sig public void run(ij.process.ImageProcessor ip)"""
        pixels = ip.getPixels()
        width = ip.getWidth()
        r = ip.getRoi()
        for y in range(r.y,r.y+r.height):
            for x in range(r.x,r.x+r.width):
                i = y*width + x;
                pixels[i] = 255-pixels[i]
@sig public void run(ij.process.ImageProcessor ip)
recipes/Python/252130_Write_a_plugin_for_ImageJ/recipe-252130.py