<html><head></head><body><div>Dear Brian,</div><div><br></div><div>thank you for your efforts! Your example works perfectly! </div><div><br></div><div>Thank you very much.</div><div><br></div><div>Cheers,</div><div>Thorsten</div><div><br></div><pre>Am Dienstag, den 21.04.2015, 11:56 -0400 schrieb Brian Northan:</pre><blockquote type="cite"><div dir="ltr"><div>Hi Thorsten<br><br></div><div>Your code looks fine.  It is a problem in my convolution ops code.<br><br></div><div>I updated the convolution branch in tutorials to work with your use-case.  <br></div><div class="gmail_extra"><div><br><a href="https://github.com/imagej/imagej-tutorials/blob/convolution/using-ops/src/main/java/ConvolutionOps.java" target="_blank">https://github.com/imagej/imagej-tutorials/blob/convolution/using-ops/src/main/java/ConvolutionOps.java</a><br><br></div><div>The problem was that the ops framework did not correctly choose 'NaiveConvolution' (direct convolution with small kernel).  Then even when I forced it to (by referring to NaiveConvolution.class directly) it did not extend the images properly (see <a href="https://github.com/imagej/imagej-ops/issues/98">https://github.com/imagej/imagej-ops/issues/98</a>)<br></div><div><br></div>If you get a chance let me know if this new example works.  The example is now too complicated, but if it works for you I can spend some time this week integrating this logic into the op (so you can write nice concise code). <br><br></div><div class="gmail_extra">Brian<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 21, 2015 at 9:35 AM, Thorsten Wagner <span dir="ltr"><<a href="mailto:wagner@biomedical-imaging.de" target="_blank">wagner@biomedical-imaging.de</a>></span> wrote:<br><blockquote type="cite"><div><div>Dear Brian,</div><div><br></div><div>thank you for the link! I'm approaching to a solution. However, I followed your tutorial but I stell get a exception:</div><div><a href="http://pastebin.com/vn84LCXx" target="_blank">http://pastebin.com/vn84LCXx</a></div><div><br></div><div>That's my code:</div><div><a href="http://pastebin.com/jeuXaycN" target="_blank">http://pastebin.com/jeuXaycN</a></div><div><br></div><div>What I'm doing wrong?</div><div><br></div><div>Cheers,</div><div>Thorsten</div><div><div><div><br></div><div><br></div><blockquote type="cite"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 20, 2015 at 4:25 PM, Curtis Rueden <span dir="ltr"><<a href="mailto:ctrueden@wisc.edu" target="_blank">ctrueden@wisc.edu</a>></span> wrote:<br><blockquote type="cite"><div dir="ltr">Hi Thorsten,<span><div><br></div><div><div>> I try to perform a simple convolution using imagej2. Unfortunately, it</div><div>> failed!</div></div><div><br></div></span><div>The exception you receive is because you are creating a new ImageJ application context, rather than reusing the existing one. This happens because you write:</div><div><br></div><div>   final ImageJ ij = new ImageJ();</div><div><br></div><div>The handle to the existing context can be obtained in one of two ways:</div><div><br></div><div>1) If you are writing an ImageJ1 plugin (e.g., an ij.plugin.Plugin), then you can write:</div><div><br></div><div><div>    // retrieve the ImageJ application context</div><div>    final Context context = (Context) IJ.runPlugIn("org.scijava.Context", "");</div><div>    final ImageJ ij = new ImageJ(context);</div></div><div><br></div><div>2) If you are writing an ImageJ2 plugin, then you can write:</div><div><br></div><div>    @Parameter</div><div>    private OpService ops</div><div><br></div><div>And just call "ops.convolve(...)" in your code.</div><div><br></div><div>Or if you really want the "ImageJ" object, you can write:</div><div><br></div><div>    @Parameter</div><div>    private ImageJ ij;</div><div><br></div><div>See also:</div><div><a href="https://github.com/imagej/imagej-tutorials/" target="_blank">https://github.com/imagej/imagej-tutorials/</a><br></div><div><br></div><div>Regards,</div><div>Curtis</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 20, 2015 at 4:53 AM, Thorsten Wagner <span dir="ltr"><<a href="mailto:wagner@biomedical-imaging.de" target="_blank">wagner@biomedical-imaging.de</a>></span> wrote:<br><blockquote type="cite">Dear list,<br>
<br>
I try to perform a simple convolution using imagej2. Unfortunately, it<br>
failed!<br>
<br>
This is my code:<br>
<a href="http://pastebin.com/CqBgcLXd" target="_blank">http://pastebin.com/CqBgcLXd</a><br>
<br>
This is the exception:<br>
<a href="http://pastebin.com/KHkeGGAJ" target="_blank">http://pastebin.com/KHkeGGAJ</a><br>
<br>
I would be grateful for any help.<br>
<br>
Regards,<br>
Thorsten<br>
<br>
_______________________________________________<br>
ImageJ-devel mailing list<br>
<a href="mailto:ImageJ-devel@imagej.net" target="_blank">ImageJ-devel@imagej.net</a><br>
<a href="http://imagej.net/mailman/listinfo/imagej-devel" target="_blank">http://imagej.net/mailman/listinfo/imagej-devel</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
ImageJ-devel mailing list<br>
<a href="mailto:ImageJ-devel@imagej.net" target="_blank">ImageJ-devel@imagej.net</a><br>
<a href="http://imagej.net/mailman/listinfo/imagej-devel" target="_blank">http://imagej.net/mailman/listinfo/imagej-devel</a><br>
<br></blockquote></div><br></div>
</blockquote></div></div></div><br></blockquote></div><br></div></div>
</blockquote></body></html>