[ImageJ-devel] Migrating an ImageJ1 plugin (Git, Ant etc.) to ImageJ2 (Git, Maven)

Johannes Schindelin Johannes.Schindelin at gmx.de
Mon Jul 30 14:26:08 CDT 2012


Hi,

On Mon, 30 Jul 2012, Curtis Rueden wrote:

> Johannes wrote:
> > Ideally, however, you would really provide the very same .jar file (and
> > likewise have really just one project) for both the IJ1 and IJ2 plugin. If
> > you wrap the ImagePlus into an ImgLib2 structure in the IJ1-specific part,
> > you should be able to use the exact same code to perform the actual
> > computation from both IJ1 and IJ2.
> 
> One downside to this approach is that by using ImageJ1's ImagePlus as your
> primary data structure, you will limit yourself to data types supported by
> ImageJ1. The other way round would be to use an ImageJ2 Dataset, which can
> be converted to an ImagePlus on the fly in IJ2's legacy layer.
> 
> I agree with Johannes that it is great to avoid duplicating code, but there
> may also be merit in maintaining a clean IJ2 version of the plugin. We will
> continue actively working on the IJ2 legacy layer to make this sort of code
> sharing easier.

Actually, that is what I meant: the core should be using plain ImgLib2,
and the IJ1 plugin should be a mere wrapper that uses imglib2-ij to wrap
an ImagePlus in an Img and then hands off to the core of the plugin.

That way, you only have to maintain one code base, and it is automatically
prepared for ImageJ2.

Ciao,
Dscho



More information about the ImageJ-devel mailing list