Login  Register

Jython/Python and ImageCalculator returning NoneType

Posted by J. Daniel Fenn on Feb 13, 2017; 5:26pm
URL: http://imagej.273.s1.nabble.com/Jython-Python-and-ImageCalculator-returning-NoneType-tp5018085.html

I'm trying the following.

'''''''
from ij import IJ, ImagePlus
from ij.plugin import ImageCalculator

imp1 = ImagePlus(fImage).show()
imp2 = ImagePlus(dImage).show()

imp3 = ImageCalculator().run("Subtract create", imp1, imp2)
imp3.show()

'''''''''

I get a NoneType error.


    imp3.show()
AttributeError: 'NoneType' object has no attribute 'show'


If I'm interpretting this correctly, then this

https://imagej.nih.gov/ij/developer/api/ij/plugin/ImageCalculator.html#ImageCalculator--

suggests ImageCalculator should return an ImagePlus object (at least in
Java, and I'm using Jython).

What am I doing wrong?  How can I get my Subtracted images to show in
python?

Thanks
-Dan

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html