[ImageJ-devel] Performing convolution using ImageJ2

Thorsten Wagner wagner at biomedical-imaging.de
Tue Apr 21 08:35:38 CDT 2015


Dear Brian,
thank you for the link! I'm approaching to a solution. However, I
followed your tutorial but I stell get a exception:
http://pastebin.com/vn84LCXx
That's my code:
http://pastebin.com/jeuXaycN
What I'm doing wrong?
Cheers,
Thorsten
> On Mon, Apr 20, 2015 at 4:25 PM, Curtis Rueden <ctrueden at wisc.edu>
> wrote:
> > Hi Thorsten,
> > 
> > > I try to perform a simple convolution using imagej2.
> > Unfortunately, it
> > > failed!
> > 
> > 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:
> > 
> >    final ImageJ ij = new ImageJ();
> > 
> > The handle to the existing context can be obtained in one of two
> > ways:
> > 
> > 1) If you are writing an ImageJ1 plugin (e.g., an
> > ij.plugin.Plugin), then you can write:
> > 
> >     // retrieve the ImageJ application context
> >     final Context context = (Context)
> > IJ.runPlugIn("org.scijava.Context", "");
> >     final ImageJ ij = new ImageJ(context);
> > 
> > 2) If you are writing an ImageJ2 plugin, then you can write:
> > 
> >     @Parameter
> >     private OpService ops
> > 
> > And just call "ops.convolve(...)" in your code.
> > 
> > Or if you really want the "ImageJ" object, you can write:
> > 
> >     @Parameter
> >     private ImageJ ij;
> > 
> > See also:
> > https://github.com/imagej/imagej-tutorials/
> > 
> > Regards,
> > Curtis
> > 
> > On Mon, Apr 20, 2015 at 4:53 AM, Thorsten Wagner <
> > wagner at biomedical-imaging.de> wrote:
> > > Dear list,
> > > 
> > > I try to perform a simple convolution using imagej2.
> > > Unfortunately, it
> > > failed!
> > > 
> > > This is my code:
> > > http://pastebin.com/CqBgcLXd
> > > 
> > > This is the exception:
> > > http://pastebin.com/KHkeGGAJ
> > > 
> > > I would be grateful for any help.
> > > 
> > > Regards,
> > > Thorsten
> > > 
> > > _______________________________________________
> > > ImageJ-devel mailing list
> > > ImageJ-devel at imagej.net
> > > http://imagej.net/mailman/listinfo/imagej-devel
> > > 
> > 
> > _______________________________________________
> > ImageJ-devel mailing list
> > ImageJ-devel at imagej.net
> > http://imagej.net/mailman/listinfo/imagej-devel
> > 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20150421/ad5be15b/attachment.html>


More information about the ImageJ-devel mailing list