Hi all, >I would like to make things friendlier by automatically converting python arrays to java, so I opened a new issue: https://github.com/scijava/scripting-jython/issues/2
After further investigation, the problem wasn't type conversion but rather that the createimg (and create) ops have a varargs parameter. Even though an array was being passed, the individual values were being unwrapped (so the Ops framework saw two parameters, instead of a single array parameter with two elements). The issue was not limited to jython scripting. I filed a PR to improve the matching logic[1] - once it's merged, the following will all work: blank = ops.create(100, 50) blank = ops.create([100, 50]) from jarray import array blank=ops.createimg(array([100, 50], 'l')) Thanks again for the help and feedback! Best, Mark [1] https://github.com/imagej/imagej-ops/pull/115 On Tue, Apr 28, 2015 at 1:54 PM, Mark Hiner <hi...@wisc.edu> wrote: > > from jarray import array >> blank=ops.createimg(array([100, 50], 'l')) >> > > Thanks for this Brian! It definitely worked for me. > > I would like to make things friendlier by automatically converting python > arrays to java, so I opened a new issue: > https://github.com/scijava/scripting-jython/issues/2 > > Thanks for pointing this out Jan. > > Best, > Mark >
_______________________________________________ ImageJ-devel mailing list ImageJ-devel@imagej.net http://imagej.net/mailman/listinfo/imagej-devel