problems upgrading ImageStack
Posted by Nicola B. on Sep 25, 2007; 11:09am
URL: http://imagej.273.s1.nabble.com/problems-upgrading-ImageStack-tp3698332.html
Hi all
I'm developing an interactive plugin and I have some problems upgrading
imageStack.
To understand working mode I try a simple code: ( I prefer if code not
use IJ.run("Add slice") )
-----------------------------------------------------------------
int width = 200;
int height = 200;
ImageStack stack = null;
ImagePlus imp = null;
stack = new ImageStack(width, height);
ColorProcessor cp1 = new ColorProcessor(width,height);
stack.addSlice("", cp1, 0);
imp = new ImagePlus("", stack);
imp.show();
ColorProcessor cp2 = new ColorProcessor(width,height);
cp2.setColor(Color.RED);
cp2.fill();
//stack.addSlice("", cp2, 1);
imp.getImageStack().addSlice("", cp2,1);
imp.updateAndRepaintWindow();
-----------------------------------------------------------------
Code works ONLY if I call "imp.show();" at the end but this is a
problem because I would show first slice and UPDATE stack when other
slide will be added.
PS: I prefer if code not use IJ.run("Add slice")
Thanks a lot
-Nicola B.