Re: Filters Public API

Posted by kostas-2 on
URL: http://imagej.273.s1.nabble.com/Filters-Public-API-tp3695891p3695893.html

That's very good. I'll try it.
Thanx a lot

Rasband Wayne wrote
The 1.41f daily build adds versions of the IJ.run(), IJ.save() and  
IJ.saveAs() that take an ImagePlus as the first argument. This  
example uses these new methods to open an image, process it, save it,  
then reopen and display the processed image:

    if (IJ.getVersion()<"1.41f")
        IJ.error("This script requires v1.41f or later");
    dir = IJ.getDirectory("home");
    img = IJ.openImage(dir+"test.jpg");
    IJ.run(img, "Unsharp Mask...", "radius=3 mask=0.6");
    IJ.run(img, "Flip Horizontally");
    IJ.run(img, "8-bit Color", "number=256");
    IJ.save(img, dir+"test.png");
    img = IJ.openImage(dir+"test.png");
    img.show();

You can run this example by pasting it into a text window and  
pressing ctrl-j (Macros>Evaluate JavaScript).

ImageJ uses a hash table with thread objects as keys and option  
strings as values to make the passing of the run() options thread  
safe, a technique suggested by Albert Cardona.

-wayne