<div dir="ltr">Hi Thorsten,<div><br></div><div><div>> I try to perform a simple convolution using imagej2. Unfortunately, it</div><div>> failed!</div></div><div><br></div><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/">https://github.com/imagej/imagej-tutorials/</a><br></div><div><br></div><div>Regards,</div><div>Curtis</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 class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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">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>
</blockquote></div><br></div>