<div dir="ltr"><div><div><div>Hi all,<br><br>>I would like to make things friendlier by automatically converting python arrays to java, so I opened a new issue: <a href="https://github.com/scijava/scripting-jython/issues/2" target="_blank">https://github.com/scijava/scripting-jython/issues/2</a><br><br></div>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).<br><br></div>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:<br><br> blank = ops.create(100, 50)<br><br> blank = ops.create([100, 50])<br><br> from jarray import array<br> blank=ops.createimg(array([100, 50], 'l'))</div><div><div><div><br></div><div>Thanks again for the help and feedback!<br><br></div><div>Best,<br></div><div>Mark<br><br>[1] <a href="https://github.com/imagej/imagej-ops/pull/115">https://github.com/imagej/imagej-ops/pull/115</a></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 28, 2015 at 1:54 PM, Mark Hiner <span dir="ltr"><<a href="mailto:hiner@wisc.edu" target="_blank">hiner@wisc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>from jarray import array<br>blank=ops.createimg(array([100, 50], 'l'))</div></blockquote><div><br></div></span><div>Thanks for this Brian! It definitely worked for me.<br><br></div><div>I would like to make things friendlier by automatically converting python arrays to java, so I opened a new issue: <a href="https://github.com/scijava/scripting-jython/issues/2" target="_blank">https://github.com/scijava/scripting-jython/issues/2</a><br><br></div><div>Thanks for pointing this out Jan.<br><br></div><div>Best,<br></div><div>Mark<br></div></div></div></div>
</blockquote></div><br></div>