Hello everyone,
I am probably doing something wrong, otherwise this looks like a bug:
import ij.*;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import ij.plugin.*;
import ij.plugin.filter.PlugInFilter;
public class Delete_First implements PlugInFilter {
ImagePlus im;
ImageStack stack;
public int setup(String arg, ImagePlus im) {
this.im = im;
return DOES_ALL+STACK_REQUIRED;
}
public void run(ImageProcessor ip) {
// Delete first slice of the stack
stack = im.getStack();
stack.deleteSlice(1);
im.updateAndDraw();
}
}
This deletes the second image of the stack. stack.deleteSlice(0) gives
an array out of bounds error.
Thanks in advance for your help. Sincerely,
JiHO
---
http://maururu.net