@@ -0,0 +1,2436 @@
+package net.restlesscoder.sandbox.imagej;%0A%0Aimport ij.ImagePlus;%0Aimport net.imagej.Dataset;%0Aimport net.imagej.ImageJ;%0Aimport net.imagej.axis.Axes;%0Aimport net.imagej.axis.AxisType;%0Aimport net.imagej.ops.Op;%0Aimport net.imagej.ops.OpEnvironment;%0Aimport net.imglib2.type.numeric.integer.UnsignedByteType;%0Aimport org.scijava.convert.ConvertService;%0Aimport org.scijava.plugin.Parameter;%0Aimport org.scijava.plugin.Plugin;%0A%0Aimport java.util.stream.IntStream;%0A%0A/**%0A * A (M)inimal, (C)omplete, and (V)erifiable (E)xample of an issue I've encountered with ConvertService.%0A *%0A * A call to ConvertService.convert(dataset, ImagePlus.class) causes an image window to pop up,%0A * when the ImageJ UI is opened (line 77).%0A *%0A * The image turns red if you move the slider from slide 1.%0A * %0A * @author Richard Domander%0A */%0A%0A@Plugin(type = Op.class, name = %22datasetWrapping%22)%0Apublic class ImageJLegacy134MVCE implements Op %7B%0A    private ImagePlus imagePlus;%0A%0A    @Parameter%0A    private ConvertService convertService;%0A%0A    @Parameter%0A    private Dataset dataset;%0A%0A    @Override%0A    public OpEnvironment ops() %7B%0A        return null;%0A    %7D%0A%0A    @Override%0A    public void setEnvironment(OpEnvironment ops) %7B%0A%0A    %7D%0A%0A    @Override%0A    public void run() %7B%0A        convertDataset();%0A    %7D%0A%0A    public static void main(final String... args) throws Exception %7B%0A        int width = 320;%0A        int height = 200;%0A        int depth = 10;%0A        final ImageJ ij = new ImageJ();%0A%0A        final Dataset inputDataset = createMonochromeDataset(ij ,width, height, depth, 0xFF);%0A%0A        ij.op().run(%22datasetWrapping%22, inputDataset);%0A%0A        ij.ui().showUI();%0A    %7D%0A%0A    private static Dataset createMonochromeDataset(final ImageJ ijInstance, final int width, final int height,%0A                                                   final int depth, final int color) %7B%0A        final long%5B%5D dims = %7Bwidth, height, depth%7D;%0A        final AxisType%5B%5D axisTypes = %7BAxes.X, Axes.Y, Axes.Z%7D;%0A        Dataset dataset = ijInstance.dataset().create(new UnsignedByteType(), dims, %22Test image%22, axisTypes);%0A%0A        IntStream.range(0, depth).forEach(i -%3E %7B%0A            final byte%5B%5D data = new byte%5Bwidth * height%5D;%0A            IntStream.range(0, data.length).forEach(j -%3E data%5Bj%5D = (byte)color);%0A            dataset.setPlane(i, data);%0A        %7D);%0A%0A        return dataset;%0A    %7D%0A%0A    private void convertDataset() %7B%0A        imagePlus = convertService.convert(dataset, ImagePlus.class);%0A    %7D%0A%7D

Add MVCE for imagej/imagej-legacy#134