Login  Register

Re: Jython/Python and ImageCalculator returning NoneType

Posted by Herbie on Feb 13, 2017; 6:03pm
URL: http://imagej.273.s1.nabble.com/Jython-Python-and-ImageCalculator-returning-NoneType-tp5018085p5018086.html

Good day Dan,

did you try the Recorder?

Here is what I get as Java-Code (sorry no experience with Jython/Python):

import ij.*;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import ij.plugin.*;

public class My_Plugin implements PlugIn {

    public void run(String arg) {
        ImageCalculator ic = new ImageCalculator();
        ImagePlus imp1 = WindowManager.getImage("Untitled");
        ImagePlus imp2 = WindowManager.getImage("Untitled-1");
        ImagePlus imp3 = ic.run("Subtract create 32-bit", imp1, imp2);
        imp3.show();
    }

}

Watch for eMail line breaks!

HTH

Herbie