|
On Nov 26, 2009, at 10:40 AM, Francesco.Decomite wrote:
> Hi everybody,
>
> I am writing a class extending ImagePlus. How can I load an
> image (PNG a priori) from inside the run method ?
> any hints ?
Here is an example of a plugin that extends ImagePlus and loads an
image in its run method.
import ij.*;
import ij.plugin.*;
public class Image_Loader extends ImagePlus implements PlugIn {
public void run(String path) {
ImagePlus imp = IJ.openImage(path);
setStack(null, imp.getStack());
setCalibration(imp.getCalibration());
show(); // display the image
}
}
-wayne
|